- Posts: 2
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // Identify the questions var q1ID = '{QID}'; var q1 = $('#question'+q1ID+''); var q2 = $(q1).nextAll('.array-flexible-row:eq(0)'); var q2ID = $(q2).attr('id').split('question')[1]; // Sort the Q2 array rows into same order as Q1 $('tr.answers-list', q1).each(function(i){ var thisCode = $(this).attr('id').split('X'+q1ID)[1]; $('table.subquestions-list tbody', q2).append($('tr.answers-list[id$="X'+q2ID+thisCode+'"]')); }); // Fix up the Q2 array row background colours $('tr.answers-list', q2).each(function(i){ $(this).removeClass('array1 array2').addClass('array'+(2-(i%2))); }); }); </script>