Welcome, Guest
Username: Password: Remember me

TOPIC: Restricting to enable choosing only one radio button from a few questions toget

Restricting to enable choosing only one radio button from a few questions toget 1 year 10 months ago #87195

  • dvey
  • dvey's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
Hi,

In the survey i need to have 3 radio button list questions.

How can i do that user will be able to choose only one radio button-

From the questions all together?

Explanation:

Each user can choose a total of ONE radio button in the whole survey.

Thanks.
:P
The administrator has disabled public write access.

Re: Restricting to enable choosing only one radio button from a few questions toget 1 year 10 months ago #87222

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4130
  • Thank you received: 763
  • Karma: 347
Assuming all radio questions are on the same page and there are no other radio questions on that page that you don't want included...

1) Set up your survey to use JavaScript.

2) Add the following script to the source of one of the questions.

The script only allows one radio button on the page to be selected.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
		$('input.radio').click(function(){
			$('input.radio').attr('checked', false);
			$(this).attr('checked', true);
		});
	});
 
</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.

Re: Restricting to enable choosing only one radio button from a few questions toget 1 year 10 months ago #87223

  • dvey
  • dvey's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
WOW
amaizing!
finally it works!!
thank you very much
:)
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.106 seconds
Donation Image