- Posts: 25
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Automatically proceed to next question after selecting answer
- tomtom
- Offline
- Junior Member
Less
More
6 years 4 months ago #160914
by tomtom
Replied by tomtom on 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.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
6 years 4 months ago #160921
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on 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
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
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- tomtom
- Offline
- Junior Member
Less
More
- Posts: 25
- Thank you received: 0
6 years 4 months ago #160924
by tomtom
Replied by tomtom on 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.
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.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
6 years 4 months ago #160930
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on 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.
Best regards
Joffm
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.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
The following user(s) said Thank You: tomtom
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
6 years 4 months ago #160935
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 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:
Sample survey attached:
Code:
<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:
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
The topic has been locked.
- tomtom
- Offline
- Junior Member
Less
More
- Posts: 25
- Thank you received: 0
6 years 4 months ago #160964
by tomtom
Replied by tomtom on 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!!!
The topic has been locked.
- csknfrt
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 1
6 years 1 month ago #164547
by csknfrt
Replied by csknfrt on 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)
I tried with radio question but it didn't work. (LS 3.4.2+180223)
Code:
<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>
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
6 years 1 month ago #164553
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 Automatically proceed to next question after selecting answer
Try this for 3.4.x:
Code:
<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.
The topic has been locked.
- csknfrt
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 1
6 years 1 month ago #164558
by csknfrt
Replied by csknfrt on 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?
- 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?
The topic has been locked.
- csknfrt
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 1
6 years 1 month ago #164565
by csknfrt
Replied by csknfrt on 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.
Code:
<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?
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
6 years 1 month ago #164567
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 Automatically proceed to next question after selecting answer
This will work in the 5 point choice (stars) type question:
This will work in sliders:
This will hide all navigation buttons:
Code:
<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:
Code:
<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:
Code:
<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.
The topic has been locked.
- csknfrt
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 1
6 years 1 month ago #164575
by csknfrt
Replied by csknfrt on topic Automatically proceed to next question after selecting answer
Thank you tpartner for your support. it works perfect.
The topic has been locked.