How to change the button text from submit to next or any others?

More
2 months 1 week ago #181447 by mrli999
I would like to change the button text from submit to next. I searched the forum and finded the following resolution:

$(document).ready(function(){
var submitText = 'Next';
$('#movesubmitbtn .ui-button-text').text(submitText);
});

I copied the above script to the template.js file, and put it at the end of this file. But doesn't work.


I inspected my survey the find the name of submit button is:
<button type="submit" id="movesubmitbtn" value="movesubmit" name="movesubmit" accesskey="l" class="submit button btn btn-lg btn-primary"> Submit </button>

And my limesurvey version is 2.65.3+170607.

If I would like to change the text for the submit button. What should I do? thanks.

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
2 months 1 week ago #181454 by Joffm
Hi,
only:

$(document).ready(function(){
var submitText = 'My new submit';
$('#movesubmitbtn').text(submitText);
});


Joffm

Tested in Version 2.73.1+171220


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
The following user(s) said Thank You: mrli999

Please Log in or Create an account to join the conversation.

More
2 months 1 week ago #181461 by mrli999
I copied your script into the template.js file. But doesn't work. The button text is still not changed. Thanks.

Please Log in or Create an account to join the conversation.

More
2 months 1 week ago - 2 months 1 week ago #181465 by Joffm
I entered it in the question text

and it works in template.js as well.

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
Last edit: 2 months 1 week ago by Joffm.
The following user(s) said Thank You: mrli999, cdorin

Please Log in or Create an account to join the conversation.

More
2 months 1 week ago #181480 by mrli999
This time it works, thanks.

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #182781 by remhk
I wasn't able to implement this for version Version 2.62.2+170203. Can this be implemented with only "3 and higher versions?

Thanks

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #182789 by tpartner
The script above should work in 2.x versions.

This will work in 3.x versions:

<script type="text/javascript" charset="utf-8">
 
	$(document).on('ready pjax:scriptcomplete',function(){
		var submitText = 'My new submit';
		$('#ls-button-submit[value="movesubmit"]').text(submitText);	
	});
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #182799 by remhk
I tried the following and it is not working:(. Where do we need to put it? I have currently placed it in the "source" of the question where the "Submit" button needs to appear.

$(document).ready(function(){
var submitText = 'Next';
$('#movesubmitbtn .ui-button-text').text(submitText);
});

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #182801 by tpartner
What LimeSurvey version?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #182802 by remhk

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #182803 by tpartner
This should work in that version. If not, activate a sample survey and give a link here so we can see the source.

<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
		var submitText = 'My new submit';
		$('#movesubmitbtn').text(submitText);
	});
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #182856 by remhk
This one worked.. Thank you!

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago #183221 by tpartner
@Nina265, to avoid confusion, please always state which LimeSurvey version your script is for.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago #183297 by DenisChenu

tpartner wrote: @Nina265, to avoid confusion, please always state which LimeSurvey version your script is for.

Since Nina put some spam link, all post deleted …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!