- Posts: 28
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Array (numbers) subquestions disabled
- AlessandraAndreotti
- Topic Author
- Offline
- Junior Member
Less
More
5 years 11 months ago - 5 years 11 months ago #168130
by AlessandraAndreotti
Array (numbers) subquestions disabled was created by AlessandraAndreotti
Hi,
I need to disable some array subquestions.
In the figure below you can find the explanation of what I need.
Moreover, I've attached a Limesurvey example.
Thanks in advance,
Alessandra
I need to disable some array subquestions.
In the figure below you can find the explanation of what I need.
Moreover, I've attached a Limesurvey example.
Thanks in advance,
Alessandra
Attachments:
Last edit: 5 years 11 months ago by AlessandraAndreotti.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
5 years 11 months ago #168133
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Array (numbers) subquestions disabled
This will do it:
Sample survey:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ $('#question{QID} tr.subquestion-list:eq(0) input[type="checkbox"]:gt(3)').prop('disabled', true); $('#question{QID} tr.subquestion-list:eq(1) input[type="checkbox"]:lt(4)').prop('disabled', true); $('#question{QID} tr.subquestion-list:eq(1) input[type="checkbox"]:gt(4)').prop('disabled', true); $('#question{QID} tr.subquestion-list:eq(2) input[type="checkbox"]:lt(5)').prop('disabled', true); }); </script>
Sample survey:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The topic has been locked.
- AlessandraAndreotti
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 0
5 years 11 months ago #168134
by AlessandraAndreotti
Replied by AlessandraAndreotti on topic Array (numbers) subquestions disabled
Hi Tony,
maybe I've explained bad myself. The image attached was just an example.
In general, when the questions group is opened, all the sub-questions must be enabled.
If the respondent answer "Column A" and/or "Column B" and/or "Column C" and/or "Column D", then the "Not available" and "Not applicable" columns must be disabled. If the respondent answer "Not available" or "Not applicable" then the remaining options ("Column A", Column B", "Column C" and "Column D") must be disabled.
This must be done in all the sub-questions.
Thanks for your appreciated help.
Alessandra
maybe I've explained bad myself. The image attached was just an example.
In general, when the questions group is opened, all the sub-questions must be enabled.
If the respondent answer "Column A" and/or "Column B" and/or "Column C" and/or "Column D", then the "Not available" and "Not applicable" columns must be disabled. If the respondent answer "Not available" or "Not applicable" then the remaining options ("Column A", Column B", "Column C" and "Column D") must be disabled.
This must be done in all the sub-questions.
Thanks for your appreciated help.
Alessandra
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
5 years 11 months ago #168135
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Array (numbers) subquestions disabled
Oops, sorry for being so literal.
Have a look at this post which describes how to render multiple columns as exclusive - www.limesurvey.org/forum/can-i-do-this-w...hers?start=15#168089
Have a look at this post which describes how to render multiple columns as exclusive - www.limesurvey.org/forum/can-i-do-this-w...hers?start=15#168089
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: AlessandraAndreotti
The topic has been locked.
- AlessandraAndreotti
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 0
5 years 11 months ago #168139
by AlessandraAndreotti
Replied by AlessandraAndreotti on topic Array (numbers) subquestions disabled
Thank you very much Tony.
It works!
Best,
Alessandra
It works!
Best,
Alessandra
The topic has been locked.