- Posts: 10
- Thank you received: 1
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 thisQuestion = $('#question{QID}'); var radio1 = $('.list-radio:eq(0)'); var radio2 = $('.list-radio:eq(1)'); // Hide this question thisQuestion.hide(); // Listeners on the radios $('input.radio', radio1).click(function(e) { var checkBox =$('input.checkbox:eq(0)', thisQuestion); if(this.value > 1) { checkBox.prop('checked', true).next('input[type="hidden"]').attr('value', 'Y'); } else { checkBox.prop('checked', false).next('input[type="hidden"]').attr('value', ''); } checkconditions(checkBox.attr('value'), checkBox.attr('name'), checkBox.attr('type')) }); $('input.radio', radio2).click(function(e) { var checkBox =$('input.checkbox:eq(1)', thisQuestion); if(this.value > 1) { checkBox.prop('checked', true).next('input[type="hidden"]').attr('value', 'Y'); } else { checkBox.prop('checked', false).next('input[type="hidden"]').attr('value', ''); } checkconditions(checkBox.attr('value'), checkBox.attr('name'), checkBox.attr('type')) }); }); </script>