Automatically proceed to next question after selecting answer

More
5 months 4 weeks ago #160914 by tomtom
tomtom replied the topic: Automatically proceed to next question after selecting answer
Hi Tony. Thank you for your great jobs. I can apply it on each raido question now. But I would like to set a "YES/NO" question for participant who will go next page if only press "NO", since they will dropdown another ordinal question for "YES" answer. Thank you.

Please Log in or Create an account to join the conversation.

More
5 months 4 weeks ago #160921 by Joffm
Joffm replied the topic: Automatically proceed to next question after selecting answer
Hi, tomtom,

why don't you place the dropdown on the next page which is only displayed if the respondent clicked "Yes"?

Of course, the easy way.

Joffm

Please Log in or Create an account to join the conversation.

More
5 months 4 weeks ago #160924 by tomtom
tomtom replied the topic: Automatically proceed to next question after selecting answer
Hello Joffm, thank you for your suggestion. Please refer to my attachments, there are two mandatory questions( 1 and 1.1).
Now I only can use the suggested code in question 1.1 to auto next. Sorry that I cannot how to describe, since if I add the code on both 1 and 1.1, the survey would pop up a mandatory problem while selecting the likert question. Please correct me, thank you so much.
Attachments:

Please Log in or Create an account to join the conversation.

More
5 months 4 weeks ago #160930 by Joffm
Joffm replied the topic: Automatically proceed to next question after selecting answer
Well,
if you think it to be absolutely necessary that the two questions appear on the same page it doesn't work.
But otherwise you can use the "normal" solution.

See attached sample.

File Attachment:

File Name: limesurvey...6579.lss
File Size:18 KB

Best regards
Joffm
Attachments:
The following user(s) said Thank You: tomtom

Please Log in or Create an account to join the conversation.

More
5 months 4 weeks ago #160935 by tpartner
tpartner replied the topic: Automatically proceed to next question after selecting answer
If you want both questions on the same page and only the first radio of the first question triggers the submit, place this script in the source of the first question:

<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
 
		$('#question{QID} .answer-item:eq(0) input.radio:eq(0)').click(function() {
			checkconditions($(this).attr('value'), $(this).attr('name'), $(this).attr('type'));
			$('#movenextbtn, #movesubmitbtn').trigger('click');
		});
 
		$('#question{QID} .answer-item:eq(0) .label-clickable').unbind();
		$('#question{QID} .answer-item:eq(0) .label-clickable').click(function() {
			$('#question{QID} .answer-item:eq(0) input.radio').unbind();
			var input = $(this).parent().find('input.radio');
			$(input).trigger('click');
			checkconditions($(input).attr('value'), $(input).attr('name'), $(input).attr('type'));
			$('#movenextbtn, #movesubmitbtn').trigger('click');
		});
	});	
</script>

Sample survey attached:

File Attachment:

File Name: limesurvey...1-23.lss
File Size:16 KB

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: tomtom

Please Log in or Create an account to join the conversation.

More
5 months 4 weeks ago #160964 by tomtom
tomtom replied the topic: Automatically proceed to next question after selecting answer
Hi Joffm and Tony. Thank you for your kindness, it is exactly what I want! If participant say NO, they will be auto passed to next, so for YES answers, participant should spend more time on thinking the likert scale answers. Great!!!

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #164547 by csknfrt
csknfrt replied the topic: Automatically proceed to next question after selecting answer
Hello,

I tried with radio question but it didn't work. (LS 3.4.2+180223)


<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
 
		$('#question{QID} input.radio').click(function() {
			checkconditions($(this).attr('value'), $(this).attr('name'), $(this).attr('type'));
			$('#movenextbtn, #movesubmitbtn').trigger('click');
		});
 
		$('#question{QID} .label-clickable').unbind();
		$('#question{QID} .label-clickable').click(function() {
			$('#question{QID} input.radio').unbind();
			var input = $(this).parent().find('input.radio');
			$(input).trigger('click');
			checkconditions($(input).attr('value'), $(input).attr('name'), $(input).attr('type'));
			$('#movenextbtn, #movesubmitbtn').trigger('click');
		});
	});	
</script>

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #164553 by tpartner
tpartner replied the topic: Automatically proceed to next question after selecting answer
Try this for 3.4.x:
<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){ 
		$('#question{QID} input[type="radio"]').on('click', function() {
			$('#ls-button-submit').trigger('click');
		});
	});	
</script>

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

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #164558 by csknfrt
csknfrt replied the topic: Automatically proceed to next question after selecting answer
Thank you tpartner it is working perfect! I have 2 question.

- May I use other question types like stars and slider?

- May I hide next, previous or send button on the question when i use this solition?

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #164565 by csknfrt
csknfrt replied the topic: Automatically proceed to next question after selecting answer
I found answer to my second question but I still don't know answer of first question.
<script> 
$(document).ready(function() {
   $('#ls-button-previous').hide();
 });  
</script>
 
 
<script> 
$(document).ready(function() {
   $('#ls-button-submit').hide();
 });  
</script>


csknfrt wrote: Thank you tpartner it is working perfect! I have 2 question.

- May I use other question types like stars and slider?

- May I hide next, previous or send button on the question when i use this solition?

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #164567 by tpartner
tpartner replied the topic: Automatically proceed to next question after selecting answer
This will work in the 5 point choice (stars) type question:

<script type="text/javascript" charset="utf-8">
	$(document).on('ready pjax:scriptcomplete',function(){ 
		$('#question{QID} input[type="radio"]').on('change', function() {
			setTimeout(function() {
				$('#ls-button-submit').trigger('click');
			}, 250);
		});
	});	
</script>

This will work in sliders:

<script type="text/javascript" charset="utf-8">
	$(document).on('ready pjax:scriptcomplete',function(){ 
		$('#question{QID} input[type="text"]').on('slideStop', function(e){
			$('#ls-button-submit').trigger('click');
		});		
	});	
</script>


This will hide all navigation buttons:

<script type="text/javascript" charset="utf-8">
	$(document).on('ready pjax:scriptcomplete',function(){
		$('#navigator-container button').hide();		
	});	
</script>

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

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #164575 by csknfrt
csknfrt replied the topic: Automatically proceed to next question after selecting answer
Thank you tpartner for your support. it works perfect.

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago #164662 by csknfrt
csknfrt replied the topic: Automatically proceed to next question after selecting answer
Hello again,

I see the js code in the "Response submission for survey Survey with results" mail. is it normal?


Hello,
 
A new response was submitted for your survey 'Survey'.
 
Click the following link to see the individual response:
http://www.musterimonemli.com/surveyx/index.php/admin/responses/sa/view/surveyid/784213/id/413
 
Click the following link to edit the individual response:
http://www.musterimonemli.com/surveyx/index.php/admin/dataentry/sa/editdata/subaction/edit/surveyid/784213/id/413
 
View statistics by clicking here:
http://www.musterimonemli.com/surveyx/index.php/admin/statistics/sa/index/surveyid/784213
 
 
The following answers were given by the participant:
Yanıt kodu	413
Gönderildiği tarih	27.02.2018 12:55:50
Son bakılan sayfa	1
Başlangıç dili	tr
Tohum	575216181
Başlangıç tarihi	27.02.2018 12:55:48
Son işlem tarihi	27.02.2018 12:55:50
IP Adresi	95.10.195.105
Gelinen İnternet Adresi	http://www.musterimonemli.com/surveyx/index.php/admin/survey/sa/view/surveyid/784213
Travel1
How ofter do you go to the travel?                   $(document).on('ready pjax:scriptcomplete',function(){ $('#navigator-container button').hide();	}); $(document).ready(function(){ $('#question input[type="radio"]').on('click', function() { $('#ls-button-submit').trigger('click'); }); });	Yes [A1][
 
 
Did you go to the travel last summer?            $(document).ready(function() { $('#ls-button-previous').hide(); }); $(document).ready(function() { $('#ls-button-submit').hide(); }); $(document).ready(function(){ $('#question input[type="radio"]').on('click', function() { $('#ls-button-submit').trigger('click'); }); });

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago #164691 by tpartner
tpartner replied the topic: Automatically proceed to next question after selecting answer
In my opinion, that is a bug. I have reported it - bugs.limesurvey.org/view.php?id=13424 .

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

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!