- Posts: 19
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Filter array by radio selection
- jlwood
- Topic Author
- Offline
- New Member
Less
More
7 years 7 months ago #141880
by jlwood
Filter array by radio selection was created by jlwood
Clearly I'm doing this wrong. I'm trying to limit the number of sub-questions in an array based on a selection in a previous radio list. I've got it working as long as the filtering array is not hidden, but when I set xafServRel in the attached sample to "Always Hide" the filter stops working.
The goal is as follows:
Select "Yes" to the first item -> See second Item "How many people" -> Select appropriate radio option -> Array is presented with 1 to 6 options, depending on choice in item 2
:S
The goal is as follows:
Select "Yes" to the first item -> See second Item "How many people" -> Select appropriate radio option -> Array is presented with 1 to 6 options, depending on choice in item 2
:S
Attachments:
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
7 years 7 months ago - 7 years 7 months ago #141881
by jelo
The problem with the advanced option to hide a question is that the question is completely removed.
Years ago there where plans to offer more than one hide mode for questions.
www.limesurvey.org/de/foren/can-i-do-thi...te-jquery-code#75966
The solution is to hide the question via Javascript or CSS.
You add this to the question-text ( source view in the editor) and hide the question (628 is the id of the question, which needs to be modified when using the snippet elsewhere)
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Filter array by radio selection
Which version/build of LimeSurvey is used?jlwood wrote: I've got it working as long as the filtering array is not hidden, but when I set xafServRel in the attached sample to "Always Hide" the filter stops working.
The problem with the advanced option to hide a question is that the question is completely removed.
Years ago there where plans to offer more than one hide mode for questions.
www.limesurvey.org/de/foren/can-i-do-thi...te-jquery-code#75966
The solution is to hide the question via Javascript or CSS.
Code:
<script> $(document).ready(function() { $('#question628').hide(); }); </script>
You add this to the question-text ( source view in the editor) and hide the question (628 is the id of the question, which needs to be modified when using the snippet elsewhere)
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Attachments:
Last edit: 7 years 7 months ago by jelo.
The following user(s) said Thank You: jlwood
The topic has been locked.
- jlwood
- Topic Author
- Offline
- New Member
Less
More
- Posts: 19
- Thank you received: 0
7 years 7 months ago #141882
by jlwood
Replied by jlwood on topic Filter array by radio selection
Thanks, I'm using v2.05 with plans to upgrade as soon as the University upgrades our version of MySQL I'll use the Javascript approach. I kept thinking there must be an option or other method I was missing, but hiding through JS won't do any real harm, just a little kludgey
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
7 years 7 months ago - 7 years 7 months ago #141885
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 Filter array by radio selection
Just to update jelo's post a bit...you can use the QID placeholder in the jQuery selector instead of the actual ID to make the workaround more generic.
Code:
$('#question{QID}').hide();
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 7 months ago by tpartner.
The following user(s) said Thank You: jlwood
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
7 years 7 months ago #141888
by jelo
Thanks for bringing it up.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Filter array by radio selection
Nice, didn't had that on my radar. Is that possible since years? Or was that introduced in 2.05?tpartner wrote: you can use the QID placeholder in the jQuery selector
Thanks for bringing it up.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
7 years 7 months ago - 7 years 7 months ago #141901
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 Filter array by radio selection
I think it was in 1.9x - when Thomas introduced Expression Manager.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 7 months ago by tpartner.
The topic has been locked.