Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Can I disable some fields within an array

Can I disable some fields within an array 2 years 7 months ago #108058

  • SvenF
  • SvenF's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Thank you received: 1
  • Karma: 2
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: 2 years 7 months ago by SvenF.
The administrator has disabled public write access.

Can I disable some fields within an array 2 years 7 months ago #108074

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6574
  • Thank you received: 1477
  • Karma: 579
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.
Last Edit: 2 years 7 months ago by tpartner.
The administrator has disabled public write access.

Can I disable some fields within an array 2 years 7 months ago #108104

  • SvenF
  • SvenF's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Thank you received: 1
  • Karma: 2
Works fine - thank you
The administrator has disabled public write access.
Time to create page: 0.225 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form