- Posts: 10216
- Thank you received: 3635
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // Find the survey, group and question IDs if($( 'input#fieldnames' ).length != 0) { var fieldNames = $('input#fieldnames').attr('value'); var tmp = fieldNames.split('X'); var sID = tmp[0]; var gID = tmp[1]; var qIDStr = $('div.multiple-opt:eq(0)').attr('id'); var tmp2 = qIDStr.split('question'); var qID = tmp2[1]; } // Place the "None of the above" option second last after randomization $('li#javatbd'+sID+'X'+gID+'X'+qID+'98').insertBefore($('.survey-question-answer li:last')); // Set an index for the second last option var itemCount = $('.survey-question-answer li').length; itemIndex = Number(itemCount-2); // Show the last two options window.setTimeout(function() { $('.survey-question-answer li:eq('+itemIndex+')').show(); $('.survey-question-answer li:eq('+itemIndex+') input[type=hidden]:eq(0)').attr('value', 'on'); $('.survey-question-answer li:last').show(); $('.survey-question-answer li:last input[type=hidden]:eq(0)').attr('value', 'on'); }, 50); }); </script>