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.

More
4 years 11 months ago #182299 by jelo

tpartner wrote: I suggest disabling AJAX in the survey theme options.

Even without your excellent workarounds we can recommend to disable AJAX mode ;-)

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: DenisChenu, ecoplan, cdorin
The topic has been locked.
More
4 years 11 months ago #183340 by ecoplan
I have a List (Radio) Single Choice Question with "other" enabled.
It seems the script needs to be modified to work with this question type too.

Any hints?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago #183357 by tpartner
This will work for list-radio questions:

Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).on('ready pjax:scriptcomplete',function(){
 
    var otherOffset = 1;
 
    var newOtherIndex = ($('#question{QID} .answer-item').length-(otherOffset+1));
 
    $('#question{QID} .answer-item:eq('+newOtherIndex+')').before($('#question{QID} .answer-item[id$="other"]'));
  });  
</script>



Sample survey attached:

File Attachment:

File Name: limesurvey...2213.lss
File Size:30 KB

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
The topic has been locked.
More
4 years 11 months ago #183380 by ecoplan
Many thanks! Your expert answers make everything look so simple... I'll try harder.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose