- Posts: 6
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
submitting an answer after click of radio button?
- collectek
- Topic Author
- Offline
- New Member
Less
More
10 years 1 month ago #106609
by collectek
submitting an answer after click of radio button? was created by collectek
Hello,
I would like to have the person taking a survey to only click the answer (radio box list) and for that click to be submitted as their answer without them having to click "submit". How could I go about doing this?
Example: survey asks a yes or no question.... person clicks yes.... answer is submitted as if they clicked the 'submit' button.
Thank you much.
I would like to have the person taking a survey to only click the answer (radio box list) and for that click to be submitted as their answer without them having to click "submit". How could I go about doing this?
Example: survey asks a yes or no question.... person clicks yes.... answer is submitted as if they clicked the 'submit' button.
Thank you much.
The topic has been locked.
- mistertomato
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
10 years 1 month ago #106643
by mistertomato
Replied by mistertomato on topic submitting an answer after click of radio button?
I would like to know this too, I believe this requires som sort of ajax call. Someone must have tried this in LimeSurvey before?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
10 years 1 month ago #106658
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 submitting an answer after click of radio button?
Do you want this for a single radio question or for all radios in a survey?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- mistertomato
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
10 years 1 month ago #106666
by mistertomato
Replied by mistertomato on topic submitting an answer after click of radio button?
I dont know about OP (collectek), but in my case it is to be used on all radio buttons in the survey. Actually being able to do this on all fields would be awesome, to make sure that all answers are received even if the user exists prematurely.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
10 years 1 month ago #106670
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 submitting an answer after click of radio button?
Well, you can't do it for all question types. For example, if you apply it to a mandatory array, the respondent will never be allowed to proceed.
To have all List (radio) questions automatically click the "Next" button, add this to the end of template.js:
To have a specific List (radio) question automatically click the "Next" button, add this to the question source:
.
To have all List (radio) questions automatically click the "Next" button, add this to the end of template.js:
Code:
$(document).ready(function() { $('.list-radio input[type="radio"]').click(function(event) { $('#movenextbtn, #movesubmitbtn').click(); }); });
To have a specific List (radio) question automatically click the "Next" button, add this to the question source:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('#question{QID} input[type="radio"]').click(function(event) { $('#movenextbtn, #movesubmitbtn').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: collectek
The topic has been locked.
- mistertomato
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
10 years 1 month ago #106672
by mistertomato
Replied by mistertomato on topic submitting an answer after click of radio button?
Thanx for the answer. But this is actually just submitting the whole page/form as I understand it.
I only want that specific answer saved (perhaps via some ajax or something), and having the rest of the page/Form available for the user to fill out.
The reason I want this, is that a lot users dont fill out all questions on the page, and never clicks the submit button. But we still want all the data they have filled out, even though they only answered i.e. 2 out of 5 questions on a page.
I hope you understand what I mean?
I only want that specific answer saved (perhaps via some ajax or something), and having the rest of the page/Form available for the user to fill out.
The reason I want this, is that a lot users dont fill out all questions on the page, and never clicks the submit button. But we still want all the data they have filled out, even though they only answered i.e. 2 out of 5 questions on a page.
I hope you understand what I mean?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
10 years 1 month ago #106674
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 submitting an answer after click of radio button?
Sorry, that's not possible.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- collectek
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
10 years 1 month ago - 10 years 1 month ago #106675
by collectek
Replied by collectek on topic submitting an answer after click of radio button?
tpartner, this is exactly what I needed - I just needed to understand that association. Most appreciated and thank you.
Last edit: 10 years 1 month ago by collectek. Reason: tpartner answered other question
The topic has been locked.