- Posts: 103
- Thank you received: 2
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); // Identify the exclusive row var thisTable = $('table.subquestion-list', thisQuestion); var exclusiveRow = $('tr[id^="javatbd"]:last', thisTable); $(exclusiveRow).addClass('exclusive-row'); // Listener on the checkboxes $(':checkbox', thisTable).on('change', function(event){ if($(this).is(':checked')) { var thisRow = $(this).closest('tr'); // Identify the column var thisIndex = $(this).closest('td').index(); // Identify the radios to be un-checked var excludedItems = $('tr.exclusive-row td.answer-item:nth-child('+(thisIndex+1)+')', thisTable); if($(thisRow).hasClass('exclusive-row')) { excludedItems = $('tr:not(.exclusive-row) td:nth-child('+(thisIndex+1)+')', thisTable); } // Un-check those checkboxes $.each(excludedItems, function(i, thisItem) { $('input[type="hidden"]', thisItem).val(''); $(':checkbox', thisItem).prop('checked', false).trigger('change'); }); } }); }); </script>
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.