- Posts: 51
- Thank you received: 1
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 = $(':radio', thisQuestion).closest('table'); var exclusiveRow = $('tr:last', thisTable); $('tr:last', thisTable).addClass('exclusive-row'); // Listener on the radios $(':radio', thisTable).on('click', function(event){ var thisCode = $(this).val(); var thisRow = $(this).closest('tr'); // Identify the radios to be un-checked var excludedInputs = $('tr.exclusive-row :radio[value="'+thisCode+'"]', thisTable); if($(thisRow).hasClass('exclusive-row')) { excludedInputs = $('tr:not(.exclusive-row) :radio[value="'+thisCode+'"]', thisTable); } // Un-check those radios $.each(excludedInputs, function(i, input) { if($(input).is(':checked')) { $(input).prop('checked', false); checkconditions('', $(input).attr('name'), 'radio'); $(input).closest('td').removeClass('active-item'); } }); }); }); </script>
Please Log in to join the conversation.
Please Log in to join the conversation.
<script type="text/javascript" > $(document).on('ready pjax:scriptcomplete',function(){ var thisQuestion = $('#question{QID}'); var thisTable = $(':radio', thisQuestion).closest('table'); function showpm(){ if($(':radio', thisQuestion).is(':checked')){$(".pm").show()} }; $(':radio', thisTable).on('click', function(event){ showpm() }); }); </script>
Please Log in to join the conversation.
<script type="text/javascript"> //Hide the rows at first $(".pre,.main,.after,.pm,.ma,.pma").hide(); $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); var thisTable = $(':radio', thisQuestion).closest('table'); // Define the actions on click $(':radio', thisTable).on('click',function(){if(($('.precar :radio:checked', thisQuestion).length > 0)&&($('.maincar :radio:checked', thisQuestion).length > 0)){$(".pm").show()}else $(".pm").hide() }); }); </script>
Please Log in to join the conversation.