- Posts: 41
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // The sub-question code to be fixed in the first position var fixedCode = '1'; var qID = '{QID}'; // Move the sub-question $('#question'+qID+' table.subquestion-list tbody:eq(0)').prepend($('#question{QID} tr.answers-list[id$="X'+qID+fixedCode+'"]')); // Fix up the row background colours $('#question'+qID+' tr.answers-list').each(function(i){ $(this).removeClass('array1, array2'); if(i % 2 == 0) { $(this).addClass('array1'); } else { $(this).addClass('array2'); } }); }); </script>