- Posts: 6
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
Please Log in to join the conversation.
4.3.15+200907
Please Log in to join the conversation.
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ var thisQuestion = $('#question{QID}'); // A listener on the checkboxes $('input:checkbox', thisQuestion).on('change', function (event) { event.stopPropagation(); handleComment($(this)); }); // Returning to page $('input:checkbox', thisQuestion).each(function (i) { handleComment($(this)); }); function handleComment(thisInput) { var thisRow = $(thisInput).closest('li'); if(thisInput.is(':checked')) { $('.text-item', thisRow).show(); } else { $('.text-item', thisRow).hide(); var textInput = $('.text-item input.form-control:eq(0)', thisRow); $(textInput).val(''); checkconditions($(textInput).val(), $(textInput).attr('name'), 'text'); } } }); </script>
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ var thisQuestion = $('#question{QID}'); // A listener on the checkboxes $('input:checkbox', thisQuestion).on('change', function (event) { handleComment($(this)); }); // Returning to page $('input:checkbox', thisQuestion).each(function (i) { handleComment($(this)); }); function handleComment(thisInput) { var thisRow = $(thisInput).closest('li'); if(thisInput.is(':checked')) { $('.text-item', thisRow).show(); } else { $('.text-item', thisRow).hide(); var textInput = $('.text-item input.form-control:eq(0)', thisRow); $(textInput).val(''); checkconditions($(textInput).val(), $(textInput).attr('name'), 'text'); } } }); </script>