Welcome, Guest
Username: Password: Remember me

TOPIC: Can I disable some fields within an array

Can I disable some fields within an array 5 months 2 weeks ago #108058

  • SvenF
  • SvenF's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 7
  • Thank you received: 1
  • Karma: 1
Hi,

I have to do an array question but not all questions have the same number of results.

It should look like this for example:
1234
question1XXXX
question2XX
question3XXXX

At question2 there should only 1 and 3 being selectable within the array.

Is this possible or must I do separate questions?
Last Edit: 5 months 2 weeks ago by SvenF.
The administrator has disabled public write access.

Can I disable some fields within an array 5 months 2 weeks ago #108074

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4266
  • Thank you received: 803
  • Karma: 368
Assuming you are using a normal array question...

You can use JavaScript/jQuery to hide some of the radio inputs.

Set up your survey to use JavaScript and add a script like below to the question source. This will hide the sixth and eighth radios in the question.

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function() {
		$('#question{QID} input.radio:eq(5)').hide();
		$('#question{QID} input.radio:eq(7)').hide();
	});
</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.
Last Edit: 5 months 2 weeks ago by tpartner.
The administrator has disabled public write access.

Can I disable some fields within an array 5 months 2 weeks ago #108104

  • SvenF
  • SvenF's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 7
  • Thank you received: 1
  • Karma: 1
Works fine - thank you
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.153 seconds
Donation Image