- Posts: 11
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Submit answer after click on yes or no
- alimeaday
- Topic Author
- Offline
- New Member
Less
More
6 years 9 months ago - 6 years 9 months ago #156876
by alimeaday
Submit answer after click on yes or no was created by alimeaday
Hello,
Is it possible that on a yes/no question in "Button Group" format you can autosubmit the answer without the user have to click on the "Next" button? So that the users only have to click on yes or no and then it goes to the next question?
I have seen in this forum some js tipps for yes/no Radio lists but they do not work for Button groups.
Thanks.
Is it possible that on a yes/no question in "Button Group" format you can autosubmit the answer without the user have to click on the "Next" button? So that the users only have to click on yes or no and then it goes to the next question?
I have seen in this forum some js tipps for yes/no Radio lists but they do not work for Button groups.
Thanks.
Last edit: 6 years 9 months ago by alimeaday.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
6 years 9 months ago #156927
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 Submit answer after click on yes or no
To apply it to a single question, place this script in the question source:
To apply it to all Yes/No questions in your survey, add this to the end of template.js:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('#question{QID} .radio').on('change', function(e) { $('#movenextbtn, #movesubmitbtn').trigger('click'); }); }); </script>
To apply it to all Yes/No questions in your survey, add this to the end of template.js:
Code:
$(document).ready(function() { $('.yes-no .radio').on('change', function(e) { $('#movenextbtn, #movesubmitbtn').trigger('click'); }); });
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: alimeaday
The topic has been locked.
- alimeaday
- Topic Author
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 0
6 years 9 months ago #156931
by alimeaday
Replied by alimeaday on topic Submit answer after click on yes or no
Thank you very much, that did the trick!
Also thanks that you included the global solution!
Also thanks that you included the global solution!
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
6 years 9 months ago #156950
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 Submit answer after click on yes or no
For informatio, i add the 300ms delay : because sometimes EM broke submit (value submitted not updated)
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.
- alimeaday
- Topic Author
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 0
6 years 9 months ago #156963
by alimeaday
Replied by alimeaday on topic Submit answer after click on yes or no
Do you mean that without the delay we might end up with the wrong answer in the database?
Is the 300 ms an educated safe guess or do we need more to be 100% safe?
Would this code line work?:
Is the 300 ms an educated safe guess or do we need more to be 100% safe?
Would this code line work?:
Code:
$(document).ready(function() { $('.yes-no .radio').on('change', function(e) { $('#movenextbtn, #movesubmitbtn').delay(300).trigger('click'); }); });
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
6 years 9 months ago #156981
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 Submit answer after click on yes or no
I see it in rare condition with a 2.05 version , unsure it's still needed.
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.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
6 years 9 months ago #156983
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 Submit answer after click on yes or no
I have never encountered that problem.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
6 years 9 months ago #157036
by DenisChenu
And since the plugin : expression manager javascript have some optimisation
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 Submit answer after click on yes or no
If i remind i have issue with some control on Array question type with some Expression Manager system in it. Didn't really remind for now.tpartner wrote: I have never encountered that problem.
And since the plugin : expression manager javascript have some optimisation
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.