- Posts: 6
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Choosing an answer will automatically trigger the survey to go to the next page
- Breezy
- Topic Author
- Offline
- New Member
Less
More
7 years 6 months ago - 7 years 6 months ago #143315
by Breezy
Choosing an answer will automatically trigger the survey to go to the next page was created by Breezy
I am creating a survey for a small pop-up window. I will have one question per page. To keep things simple, I would like the to survey to automatically go to the next page immediately after the answer is selected so I can hide the next button to save space. Is that doable? It would be similar to the Google consumer surveys (example:
www.google.com/insights/consumersurveys/websat_example
)
Last edit: 7 years 6 months ago by Breezy. Reason: Typo
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3970
7 years 6 months ago #143318
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Choosing an answer will automatically trigger the survey to go to the next page
Hi, Breezy,
please have a look at this thread
www.limesurvey.org/de/foren/can-i-do-thi...ithout-clicking-next
I am also interested in a possibility to proceed automatically if the maximum length in a numerical input is reached.
Best regards
Joffm
please have a look at this thread
www.limesurvey.org/de/foren/can-i-do-thi...ithout-clicking-next
I am also interested in a possibility to proceed automatically if the maximum length in a numerical input is reached.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Breezy
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
7 years 6 months ago #143323
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Choosing an answer will automatically trigger the survey to go to the next page
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.
Code:
<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>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Joffm
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
7 years 6 months ago #143324
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Choosing an answer will automatically trigger the survey to go to the next page
...again, all sorts of caveats about the respondent not being able to fix errors with these auto-submit workarounds.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Breezy
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
7 years 6 months ago #143334
by Breezy
Replied by Breezy on topic Choosing an answer will automatically trigger the survey to go to the next page
I tried using the code for the following link:
www.limesurvey.org/de/foren/can-i-do-thi...ithout-clicking-next
When I click a radio button, the page refreshes but the question is the same. It doesn't seem to go to the next page. Any idea on why this would be?
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
Code:
<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>
When I click a radio button, the page refreshes but the question is the same. It doesn't seem to go to the next page. Any idea on why this would be?
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
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $('#question{QID} input.radio').click(function() { $('#movenextbtn, #movesubmitbtn').trigger('click'); }); }); </script>
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3970
7 years 6 months ago #143342
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Choosing an answer will automatically trigger the survey to go to the next page
Hi, Tony,
I use LS in this case to enter paper-pencil questionnaires.
Here everything is typed as numeric input, because this is much faster then using the mouse clicking radios or checkboxes.
I was looking for a solution like yours to avoid the use of the TAB key.
And most of the question are answered with a 1 digit code.
Thank you very much
Joffm
I use LS in this case to enter paper-pencil questionnaires.
Here everything is typed as numeric input, because this is much faster then using the mouse clicking radios or checkboxes.
I was looking for a solution like yours to avoid the use of the TAB key.
And most of the question are answered with a 1 digit code.
Thank you very much
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
7 years 6 months ago #143360
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Choosing an answer will automatically trigger the survey to go to the next page
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
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Breezy
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
7 years 6 months ago #143384
by Breezy
Replied by Breezy on topic Choosing an answer will automatically trigger the survey to go to the next page
I'm using Version 2.54.3+161014 and the standard newspaper template
The topic has been locked.
- Breezy
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
7 years 6 months ago - 7 years 6 months ago #143394
by Breezy
Replied by Breezy on topic Choosing an answer will automatically trigger the survey to go to the next page
Here's a link to an example: [LINK REMOVED]
Last edit: 7 years 6 months ago by tpartner.
The topic has been locked.
- Breezy
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
7 years 6 months ago #143402
by Breezy
Replied by Breezy on topic Choosing an answer will automatically trigger the survey to go to the next page
It works if I clicked directly on the radio button but not if I click on the label. I am debugging now so the link above will no longer work
The topic has been locked.
- Breezy
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
7 years 6 months ago - 7 years 6 months ago #143549
by Breezy
Replied by Breezy on topic Choosing an answer will automatically trigger the survey to go to the next page
Through some debugging I was able to finally get it to work. I hesitated to post this because I am sure that this is a very indirect way to do it but at least it works for me. I needed to add 10 ms delay to the click. I added the following to template.js
Code:
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')) ...
Last edit: 7 years 6 months ago by Breezy.
The topic has been locked.