- Posts: 146
- Thank you received: 2
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to change the button text from submit to next or any others?
- mrli999
- Topic Author
- Offline
- Premium Member
Less
More
5 years 1 month ago #181447
by mrli999
How to change the button text from submit to next or any others? was created 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.
$(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.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3975
5 years 1 month ago #181454
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to change the button text from submit to next or any others?
Hi,
only:
$(document).ready(function(){
var submitText = 'My new submit';
$('#movesubmitbtn').text(submitText);
});
Joffm
Tested in Version 2.73.1+171220
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
The following user(s) said Thank You: mrli999
The topic has been locked.
- mrli999
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 146
- Thank you received: 2
5 years 1 month ago #181461
by mrli999
Replied by mrli999 on topic How to change the button text from submit to next or any others?
I copied your script into the template.js file. But doesn't work. The button text is still not changed. Thanks.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3975
5 years 1 month ago - 5 years 1 month ago #181465
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to change the button text from submit to next or any others?
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 5 years 1 month ago by Joffm.
The following user(s) said Thank You: mrli999, cdorin
The topic has been locked.
- mrli999
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 146
- Thank you received: 2
5 years 1 month ago #181480
by mrli999
Replied by mrli999 on topic How to change the button text from submit to next or any others?
This time it works, thanks.
The topic has been locked.
- remhk
- Offline
- Junior Member
Less
More
- Posts: 23
- Thank you received: 0
5 years 2 weeks ago #182781
by remhk
Replied by remhk on topic How to change the button text from submit to next or any others?
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
Thanks
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10104
- Thank you received: 3593
5 years 2 weeks ago #182789
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic How to change the button text from submit to next or any others?
The script above should work in 2.x versions.
This will work in 3.x versions:
This will work in 3.x versions:
Code:
<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.
The topic has been locked.
- remhk
- Offline
- Junior Member
Less
More
- Posts: 23
- Thank you received: 0
5 years 2 weeks ago #182799
by remhk
Replied by remhk on topic How to change the button text from submit to next or any others?
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);
});
$(document).ready(function(){
var submitText = 'Next';
$('#movesubmitbtn .ui-button-text').text(submitText);
});
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10104
- Thank you received: 3593
5 years 2 weeks ago #182801
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic How to change the button text from submit to next or any others?
What LimeSurvey version?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- remhk
- Offline
- Junior Member
Less
More
- Posts: 23
- Thank you received: 0
5 years 2 weeks ago #182802
by remhk
Replied by remhk on topic How to change the button text from submit to next or any others?
Version 2.62.2+170203
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10104
- Thank you received: 3593
5 years 2 weeks ago #182803
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic How to change the button text from submit to next or any others?
This should work in that version. If not, activate a sample survey and give a link here so we can see the source.
Code:
<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.
The topic has been locked.
- remhk
- Offline
- Junior Member
Less
More
- Posts: 23
- Thank you received: 0
5 years 2 weeks ago #182856
by remhk
Replied by remhk on topic How to change the button text from submit to next or any others?
This one worked.. Thank you!
The topic has been locked.