Choosing an answer will automatically trigger the survey to go to the next page

Mehr
1 Jahr 4 Monate her - 1 Jahr 4 Monate her #143315 von Breezy
Breezy erstellte das Thema Choosing an answer will automatically trigger the survey to go to the next page
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: https://www.google.com/insights/consumersurveys/websat_example )
Letzte Änderung: 1 Jahr 4 Monate her von Breezy. Begründung: Typo

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 4 Monate her #143318 von Joffm
Joffm antwortete auf das Thema: Choosing an answer will automatically trigger the survey to go to the next page
Hi, Breezy,
please have a look at this thread
https://www.limesurvey.org/de/foren/can-i-do-this-with-limesurvey/93392-automatically-proceed-to-next-question-without-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
Folgende Benutzer bedankten sich: Breezy

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 4 Monate her #143323 von tpartner
tpartner antwortete auf das Thema: Choosing an answer will automatically trigger the survey to go to the next page

I am also interested in a possibility to proceed automatically if the maximum length in a numerical input is reached.

Try this in the source of a numeric question:

<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.
Folgende Benutzer bedankten sich: Joffm

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 4 Monate her #143324 von tpartner
tpartner antwortete auf das Thema: 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.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 4 Monate her #143334 von Breezy
Breezy antwortete auf das Thema: Choosing an answer will automatically trigger the survey to go to the next page
I tried using the code for the following link: https://www.limesurvey.org/de/foren/can-i-do-this-with-limesurvey/93392-automatically-proceed-to-next-question-without-clicking-next
<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
<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
 
		$('#question{QID} input.radio').click(function() {
			$('#movenextbtn, #movesubmitbtn').trigger('click');
		});
	});
</script>

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 4 Monate her #143342 von Joffm
Joffm antwortete auf das Thema: 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

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 4 Monate her #143360 von tpartner
tpartner antwortete auf das Thema: Choosing an answer will automatically trigger the survey to go to the next page

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

LimeSurvey version? Template used?

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 4 Monate her #143384 von Breezy
Breezy antwortete auf das Thema: 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

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 4 Monate her - 1 Jahr 4 Monate her #143394 von Breezy
Breezy antwortete auf das Thema: Choosing an answer will automatically trigger the survey to go to the next page
Here's a link to an example: [LINK REMOVED]
Letzte Änderung: 1 Jahr 4 Monate her von tpartner.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 4 Monate her #143402 von Breezy
Breezy antwortete auf das Thema: 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

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
1 Jahr 3 Monate her - 1 Jahr 3 Monate her #143549 von Breezy
Breezy antwortete auf das Thema: 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
 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'))	
 
   ... 	
Letzte Änderung: 1 Jahr 3 Monate her von Breezy.

Bitte Anmelden um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha