- Posts: 16
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
For the user who read ittpartner wrote: Why do I bother commenting code if no one reads it?
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Listener on the column-2/column-3 checkboxes $('#question{QID} td.question-item:nth-child(3) input[type="checkbox"], #question{QID} td.question-item:nth-child(4) input[type="checkbox"]').on('change', function(e) { if($(this).is(':checked')) { var targetIndex = 3; if($(this).closest('td').is(':nth-child(3)')) { targetIndex = 4; } var thisRow = $(this).closest('tr'); // Uncheck the other checkbox $('td.question-item:nth-child('+targetIndex+') input[type="checkbox"]', thisRow).prop('checked', false).trigger('change'); } }); }); </script>