- Posts: 6
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Try this in the source of a numeric question:I am also interested in a possibility to proceed automatically if the maximum length in a numerical input is reached.
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ var thisQuestion = $('#question{QID}'); var maxLength = $('input[type="text"]:eq(0)', thisQuestion).attr('maxlength'); $('input[type="text"]', thisQuestion).on('keyup', function(e) { if($(this).val().length == maxLength) { $('#movenextbtn, #movesubmitbtn').trigger('click'); } }); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $('#question{QID} input.radio').click(function() { if($('#movesubmitbtn').length > 0) { document.limesurvey.move.value = 'movesubmit'; } else { document.limesurvey.move.value = 'movenext'; } document.limesurvey.submit(); }); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $('#question{QID} input.radio').click(function() { $('#movenextbtn, #movesubmitbtn').trigger('click'); }); }); </script>
LimeSurvey version? Template used?I tried the following but then it doesn't register the answer before it clicks next. If I click the answer twice then it works
function nextQ() { $('#movenextbtn, #movesubmitbtn').trigger('click'); } function appendClick(robject) { robject.attr("onclick",robject.attr("onclick") + ';setTimeout(nextQ, 10)'); } $(document).ready(function() { appendClick($('.radio-list input.radio')) ...