- Posts: 4
- 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 qHidden = $('#question{QID}'); var q1 = $(qHidden).prevAll('.multiple-opt:eq(0)'); // Hide the hidden question $(qHidden).css({ 'position': 'absolute', 'left': '-999em', 'height': '0' }) // Listener on Q1 $('input.checkbox', q1).click(function(event){ // Reset the hidden question $('input.checkbox', qHidden).each(function(i) { $(this).prop('checked', false); checkconditions($(this).attr('value'), $(this).attr('name'), $(this).attr('type')); }); // Check the first visible box in the hidden question var firstItem = $('li.question-item:visible:eq(0) input.checkbox', qHidden); $(firstItem).click(); }); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // Identify the questions var qHidden = $('#question{QID}'); // Hide the hidden question $(qHidden).css({ 'position': 'absolute', 'left': '-999em', 'height': '0' }) // Reset the hidden question $('input.checkbox', qHidden).each(function(i) { $(this).prop('checked', false); checkconditions($(this).attr('value'), $(this).attr('name'), $(this).attr('type')); }); // Check the first visible box in the hidden question var firstItem = $('li.question-item:visible:eq(0) input.checkbox', qHidden); $(firstItem).click(); }); </script>