- Posts: 26
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify the questions var qID = {QID}; var q = $('#question'+qID); // Default answers $('table.subquestion-list tr.answers-list', q).each(function(i) { if($('input[type="radio"]:checked', this).length == 0) { $('input[type="radio"]:first', this).trigger('click'); } }); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); // Loop through first-row answers $('tr.answers-list:eq(0) input[type="radio"]', thisQuestion).each(function(i) { // Disable the first radio in the first column if(i == 0) { $(this).prop('disabled', true); } // Default answers else { var thisName = $(this).attr('name'); if($('input[type="radio"][name="'+thisName+'"]:checked', thisQuestion).length == 0) { $(this).trigger('click'); } } }); }); </script>