Check out the LimeSurvey source code on GitHub!

Can I disable some fields within an array

More
2 years 8 months ago - 2 years 8 months ago #108058 by SvenF
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 8 months ago by SvenF.

Please Log in to join the conversation.

More
2 years 8 months ago - 2 years 8 months ago #108074 by tpartner
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 8 months ago by tpartner.

Please Log in to join the conversation.

More
2 years 8 months ago #108104 by SvenF
Works fine - thank you

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form