- Posts: 55
- Thank you received: 1
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
- Siem
- Topic Author
- Offline
- Senior Member
Less
More
7 years 1 month ago #149263
by Siem
Automatically proceed to next question after selecting answer was created by Siem
I have a survey with a list with radio-buttons and I would like the user to proceed to next question after selecting answer.
I have found some javascript solutions on this forum such as this one:
However I get this error when I implement (adding the code to "question.pstpl") it:
I run the default template on version 2.63.0+170304
What can I do to make this work?
I have found some javascript solutions on this forum such as this one:
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'); }); }); </script>
However I get this error when I implement (adding the code to "question.pstpl") it:
Code:
One or more mandatory questions have not been answered . Please answer this first to proceed !
I run the default template on version 2.63.0+170304
What can I do to make this work?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
7 years 1 month ago #149265
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
I just tested and it works fine for me with a single list-radio question on a page. Do you have other mandatory questions on that page?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
7 years 1 month ago #149267
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
Oh, wait, there's a conflict when clicking on the .label-clickable elements. Try this:
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>
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: tomtom
The topic has been locked.
- Siem
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 1
7 years 1 month ago #149291
by Siem
Replied by Siem on topic Automatically proceed to next question after selecting answer
Many thanks, this solution works perfectly!
The topic has been locked.
- hafees89
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
6 years 7 months ago #158319
by hafees89
Replied by hafees89 on topic Automatically proceed to next question after selecting answer
How if I wanna do for 1 question only? This 1 will automatically proceed to next question for every question right. How if 1 question only I wanna do? Mind to help? Thank you.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13642
- Thank you received: 2491
6 years 7 months ago #158325
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Automatically proceed to next question after selecting answer
@tpartner : adding $(input).trigger('click'); trigger ('#question{QID} input.radio').click(function() , then it must work witout the 2 lines after ? No ?
/me must review framagit.org/SondagePro-LimeSurvey-plugi...assets/autosubmit.js
/me must review framagit.org/SondagePro-LimeSurvey-plugi...assets/autosubmit.js
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- hafees89
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
6 years 7 months ago - 6 years 7 months ago #158327
by hafees89
Replied by hafees89 on topic Automatically proceed to next question after selecting answer
Let say I have 5 question all using radio button. But for the 1st question only I wanna use automatic next. It is possible? Kindly advice me on this. Thank you sir.
I'll review ur code sir.. Thank you again..
I'll review ur code sir.. Thank you again..
Last edit: 6 years 7 months ago by hafees89.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
6 years 7 months ago #158347
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
@DenisChenu, sure, maybe - that was just a quick fix.
@hafees89, are all radios on the same page?
@hafees89, are all radios on the same page?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- marektondryk
- Offline
- Premium Member
Less
More
- Posts: 105
- Thank you received: 0
6 years 7 months ago #158353
by marektondryk
Where should I put this code?
Replied by marektondryk on topic Automatically proceed to next question after selecting answer
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>
Where should I put this code?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
6 years 7 months ago #158357
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
In the question source -
manual.limesurvey.org/Workarounds:_Manip...tc..29_in_LimeSurvey
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- marektondryk
- Offline
- Premium Member
Less
More
- Posts: 105
- Thank you received: 0
6 years 7 months ago #158374
by marektondryk
Replied by marektondryk on topic Automatically proceed to next question after selecting answer
Thanks Tony!
But how can I hide button NEXT on question pages?
But how can I hide button NEXT on question pages?
The topic has been locked.
- hafees89
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
6 years 7 months ago - 6 years 7 months ago #158376
by hafees89
Replied by hafees89 on topic Automatically proceed to next question after selecting answer
Yes, all radios on the same page.. Only wanna change for the 1st question using auto next..
Attachments:
Last edit: 6 years 7 months ago by hafees89.
The topic has been locked.