- Posts: 11
- 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() { $('#answer855275X6068X50438SQ001_1').attr('checked',true); $('#answer855275X6068X50438SQ002_2').attr('checked',true); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Default answer for Row "SQ001" if($('#question{QID} .answers-list[id$="SQ001"] input.radio:checked').length == 0) { $('#question{QID} input.radio[id$="SQ001-1"]').trigger('click'); } // Default answer for Row "SQ002" if($('#question{QID} .answers-list[id$="SQ002"] input.radio:checked').length == 0) { $('#question{QID} input.radio[id$="SQ002-2"]').trigger('click'); } }); </script>
tpartner wrote: It seems to me that both of those approaches will reset the question to the default values when returning to the group.
I would do this with JavaScript:
Code:<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Default answer for Row "SQ001" if($('#question{QID} .answers-list[id$="SQ001"] input.radio:checked').length == 0) { $('#question{QID} input.radio[id$="SQ001-1"]').trigger('click'); } // Default answer for Row "SQ002" if($('#question{QID} .answers-list[id$="SQ002"] input.radio:checked').length == 0) { $('#question{QID} input.radio[id$="SQ002-2"]').trigger('click'); } }); </script>