- Posts: 3
- 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(){ var qID = QQ; // Loop through the rows and check the first radio if none are already checked $('#question'+qID+' table.question tbody tr').each(function(i) { if($('input.radio:checked', this).length == 0) { $('input.radio:eq(0)', this).attr('checked', true); } }); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $('#questionQQ select').each(function(i) { if($(this).val() == '') { $('option[value!=""]:first', this).attr('selected', 'selected'); } }); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ var qID = QQ; // Loop through the rows and check the first radio if none are already checked $('#question'+qID+' table.question tbody tr').each(function(i) { if($('input.radio:checked', this).length == 0) { $('input.radio:eq(0)', this).attr('checked', true); } }); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify this question ID var qID = {QID}; // Loop through the rows and check the first radio if none are already checked $('#question'+qID+' table.question tbody tr').each(function(i) { if($('input.radio:checked', this).length == 0) { $('input.radio:eq(0)', this).attr('checked', true); } }); }); </script>
$('input.radio:eq(0)', this).attr('checked', true);
$('input.radio:last', this).attr('checked', true);