Can I disable some fields within an array

More
3 years 3 weeks ago - 3 years 3 weeks ago #108058 by SvenF
SvenF created the topic: Can I disable some fields within an array
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: 3 years 3 weeks ago by SvenF.

Please Log in to join the conversation.

More
3 years 3 weeks ago - 3 years 3 weeks ago #108074 by tpartner
tpartner replied the topic: Can I disable some fields within an array
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: 3 years 3 weeks ago by tpartner.

Please Log in to join the conversation.

More
3 years 3 weeks ago #108104 by SvenF
SvenF replied the topic: Can I disable some fields within an array
Works fine - thank you

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now