- Posts: 18
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
//this fails var dir = '{Q2_SQ001.NAOK}';
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify this question var thisQuestion = $('#question{QID}'); // Assign event function to comment boxes $('input[type="text"]', thisQuestion).on('change', function() { var targetQuestion = $('#question3'); // this is Q3 reference var dir = '{Q2_SQ001.NAOK}'; }); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify this question var thisQuestion = $('#question{QID}'); // Assign event function to checkboxes $('input[type="text"]', thisQuestion).on('change', function() { var targetQuestion = $('#question1831'); //Question 3 if ($('input.checkbox:eq(0)', thisQuestion).is(':checked')) { $('input.checkbox:eq(6)', targetQuestion).attr('checked', true); $('input.checkbox:eq(6)', targetQuestion).parent().find('input[type="hidden"]').val('Y'); }; }); }); </script>