- Posts: 10223
- Thank you received: 3640
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ addQuestionReset('{QID}'); function addQuestionReset(qID) { var thisQuestion = $('#question'+qID+''); $('table.subquestion-list', thisQuestion).after('<input type="button" style="float:right;" value="Reset Question" class="resetQuestionButton" />'); $('.resetQuestionButton', thisQuestion).click(function(e){ $('input.radio', thisQuestion).prop('disabled', false); $('input.radio:checked', thisQuestion).each(function(i) { $(this).prop('checked', false); checkconditions('', this.name, this.type); }); }); } }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ addQuestionReset('{QID}'); function addQuestionReset(qID) { var thisQuestion = $('#question'+qID+''); $('table.subquestion-list', thisQuestion).after('<input type="button" style="float:right;" value="Reset Question" class="resetQuestionButton" />'); $('.resetQuestionButton', thisQuestion).click(function(e){ if($('input.radio[value=""]', thisQuestion).length > 0) { $('input.radio[value=""]', thisQuestion).trigger('click'); } else { $('input.radio', thisQuestion).prop('disabled', false).prop('checked', false); } $('input.radio', thisQuestion).each(function(i) { checkconditions(this.value, this.name, this.type); }); }); } }); </script>