- Posts: 9
- 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 this question var thisQuestion = $('#question{QID}'); // Get the Q1 answers var q1Row1 = '{q1_1.NAOK}'; var q1Row2 = '{q1_2.NAOK}'; var q1Row3 = '{q1_3.NAOK}'; var q1Row4 = '{q1_4.NAOK}'; // Check the appropriate boxes if(q1Row1 == 1 || q1Row1 == 2) { $('input.checkbox:eq(0)', thisQuestion).prop('checked', true); $('input.checkbox:eq(0)', thisQuestion).parent().find('input[type="hidden"]').val('Y'); } if(q1Row2 == 1 || q1Row2 == 2) { $('input.checkbox:eq(1)', thisQuestion).prop('checked', true); $('input.checkbox:eq(1)', thisQuestion).parent().find('input[type="hidden"]').val('Y'); } if(q1Row3 == 1 || q1Row3 == 2) { $('input.checkbox:eq(2)', thisQuestion).prop('checked', true); $('input.checkbox:eq(2)', thisQuestion).parent().find('input[type="hidden"]').val('Y'); } if(q1Row4 == 1 || q1Row4 == 2) { $('input.checkbox:eq(3)', thisQuestion).prop('checked', true); $('input.checkbox:eq(3)', thisQuestion).parent().find('input[type="hidden"]').val('Y'); } }); </script>
Yep!granen wrote: Does the following choose the first checkbox?
('input.checkbox:eq(0)
I'm sorry, I don't understand. What is a "java" question?Is it possible to have this java question on the same page as a second question...