- Posts: 965
- Thank you received: 218
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Re-order "other" option in multiple choice question.
- tammo
- Topic Author
- Offline
- Official LimeSurvey Partner
Less
More
7 years 10 months ago - 7 years 10 months ago #137696
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Re-order "other" option in multiple choice question. was created by tammo
I am quite sure I have seen an answer, most probable by tpartner to this question, but after some searching I have not found it.
I have a multiple choice question where the "other" option should not be the last one. It should be like this:
[ ] Answer A
[ ] Answer B
[ ] Answer C
[ ] Other: _____
[ ] None of the above
Can anyone indicate the direction where I can find a solution for this? Thanks in advance.
I have a multiple choice question where the "other" option should not be the last one. It should be like this:
[ ] Answer A
[ ] Answer B
[ ] Answer C
[ ] Other: _____
[ ] None of the above
Can anyone indicate the direction where I can find a solution for this? Thanks in advance.
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Last edit: 7 years 10 months ago by tammo.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
7 years 10 months ago #137702
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 Re-order "other" option in multiple choice question.
Hi Tammo, 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.
- tammo
- Topic Author
- Offline
- Official LimeSurvey Partner
Less
More
- Posts: 965
- Thank you received: 218
7 years 10 months ago #137703
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Replied by tammo on topic Re-order "other" option in multiple choice question.
2.50, 160606
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
7 years 10 months ago #137704
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 Re-order "other" option in multiple choice question.
Add this script to the question source and adjust "otherOffset" as necessary:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ var otherOffset = 1; var newOtherIndex = ($('#question{QID} div.question-item').length-(otherOffset+1)); $('#question{QID} div.question-item:eq('+newOtherIndex+')').parent().before($('#question{QID} div.question-item[id$="other"]').parent()); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: tammo, coeneisma
The topic has been locked.
- tammo
- Topic Author
- Offline
- Official LimeSurvey Partner
Less
More
- Posts: 965
- Thank you received: 218
7 years 10 months ago #137706
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Replied by tammo on topic Re-order "other" option in multiple choice question.
This works!
Thank you very much!
Tammo
Thank you very much!
Tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
- RaCMJS
- Offline
- Junior Member
Less
More
- Posts: 34
- Thank you received: 1
7 years 2 months ago #148764
by RaCMJS
Replied by RaCMJS on topic Re-order "other" option in multiple choice question.
Is there a way to make this work on an older version (Version 2.05+ Build 150310)? Currently don't have the capacity to upgrade. I tried this solution and it doesn't work. Is there another work around that might work?
Thanks,
S
Thanks,
S
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
7 years 2 months ago #148765
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 Re-order "other" option in multiple choice question.
For 2.05 and 2.06:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ var otherOffset = 1; var newOtherIndex = ($('#question{QID} .question-item').length-(otherOffset+1)); $('#question{QID} .question-item:eq('+newOtherIndex+')').before($('#question{QID} .question-item[id$="other"]')); }); </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.
- RaCMJS
- Offline
- Junior Member
Less
More
- Posts: 34
- Thank you received: 1
7 years 2 months ago #148766
by RaCMJS
Replied by RaCMJS on topic Re-order "other" option in multiple choice question.
Thank you so much! This works!
The topic has been locked.
- ecoplan
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
5 years 3 weeks ago #182288
by ecoplan
Replied by ecoplan on topic Re-order "other" option in multiple choice question.
With the new LS 3.16 the script is not working anymore.
If you could help adapt it I'd be very thankful.
Kind regards, Simon
If you could help adapt it I'd be very thankful.
Kind regards, Simon
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
5 years 3 weeks ago - 5 years 3 weeks ago #182291
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 Re-order "other" option in multiple choice question.
This script works in 3.16.x:
Sample survey attached:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ var otherOffset = 1; var newOtherIndex = ($('#question{QID} .question-item').length-(otherOffset+1)); $('#question{QID} .question-item:eq('+newOtherIndex+')').before($('#question{QID} .question-item[id$="other"]')); }); </script>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 5 years 3 weeks ago by tpartner.
The following user(s) said Thank You: DenisChenu, ecoplan
The topic has been locked.
- ecoplan
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
5 years 3 weeks ago #182295
by ecoplan
Replied by ecoplan on topic Re-order "other" option in multiple choice question.
Flawless as always, thanks tpartner!
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
5 years 3 weeks ago #182296
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 Re-order "other" option in multiple choice question.
You are welcome.
One note: as with all of my workarounds, I suggest disabling AJAX in the survey theme options.
One note: as with all of my workarounds, I suggest disabling AJAX in the survey theme options.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: ecoplan, cdorin
The topic has been locked.