Welcome, Guest
Username: Password: Remember me

TOPIC: submitting an answer after click of radio button?

submitting an answer after click of radio button? 6 months 4 weeks ago #106609

  • collectek
  • collectek's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
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.
The administrator has disabled public write access.

submitting an answer after click of radio button? 6 months 4 weeks ago #106643

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 administrator has disabled public write access.

submitting an answer after click of radio button? 6 months 3 weeks ago #106658

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4271
  • Thank you received: 806
  • Karma: 369
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

submitting an answer after click of radio button? 6 months 3 weeks ago #106666

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 administrator has disabled public write access.

submitting an answer after click of radio button? 6 months 3 weeks ago #106670

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4271
  • Thank you received: 806
  • Karma: 369
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:
$(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:
<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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: collectek

submitting an answer after click of radio button? 6 months 3 weeks ago #106672

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?
The administrator has disabled public write access.

submitting an answer after click of radio button? 6 months 3 weeks ago #106674

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4271
  • Thank you received: 806
  • Karma: 369
Sorry, that's not possible.
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

submitting an answer after click of radio button? 6 months 3 weeks ago #106675

  • collectek
  • collectek's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Karma: 0
tpartner, this is exactly what I needed - I just needed to understand that association. Most appreciated and thank you.
Last Edit: 6 months 3 weeks ago by collectek. Reason: tpartner answered other question
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.126 seconds
Donation Image