- Posts: 41
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Hide a ListRadio option based on the answer to previous ListRadio question.
- jackuars
- Topic Author
- Offline
- Senior Member
Less
More
6 years 6 months ago - 6 years 6 months ago #158218
by jackuars
Hide a ListRadio option based on the answer to previous ListRadio question. was created by jackuars
So my first question is like this
Q1. Which product do you use most often? (ListRadio)
1. product A
2. product B
3. product C (if the user selects this)
4. product D
Q2. Which product will you never consider using? (ListRadio)
1. product A
2. product B
3. product C (this option should not appear here)
4. product D
If the user selects "product C" in Q1, then that option should not appear in Q2. Similarly if he selects "product B" in Q1, the option should not appear in Q2 and so on.
I tried this earlier.
1.{if( Q1.NAOK != '1', 'product A', '' )}
2. {if( Q1.NAOK != '2', 'product B', '' )}
3. {if( Q1.NAOK != '3', 'product C', '' )}
4. {if( Q1.NAOK != '4', 'product D', '' )}
as answer options to Q2, but this only hides the answer text in Q2 if not selected in Q1 but not the radio button. It also looks clunky.
Q1. Which product do you use most often? (ListRadio)
1. product A
2. product B
3. product C (if the user selects this)
4. product D
Q2. Which product will you never consider using? (ListRadio)
1. product A
2. product B
3. product C (this option should not appear here)
4. product D
If the user selects "product C" in Q1, then that option should not appear in Q2. Similarly if he selects "product B" in Q1, the option should not appear in Q2 and so on.
I tried this earlier.
1.{if( Q1.NAOK != '1', 'product A', '' )}
2. {if( Q1.NAOK != '2', 'product B', '' )}
3. {if( Q1.NAOK != '3', 'product C', '' )}
4. {if( Q1.NAOK != '4', 'product D', '' )}
as answer options to Q2, but this only hides the answer text in Q2 if not selected in Q1 but not the radio button. It also looks clunky.
Last edit: 6 years 6 months ago by jackuars.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
6 years 6 months ago #158233
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 Hide a ListRadio option based on the answer to previous ListRadio question.
There is no direct filtering for list-radio questions. You will need to use JavaScript.
Are the questions on the same page, and, if so, are they consecutively placed?
Are the questions on the same page, and, if so, are they consecutively placed?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- jackuars
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 41
- Thank you received: 0
6 years 6 months ago #158261
by jackuars
Replied by jackuars on topic Hide a ListRadio option based on the answer to previous ListRadio question.
The questions are on different pages in a question by question format, and even though they usually appear consecutively, there are times when they appear 2 questions or so apart
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
6 years 6 months ago #158267
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 Hide a ListRadio option based on the answer to previous ListRadio question.
I that case, you will not be able to filter the question. The only way (that I know of) to filter radios on separate pages is to insert a hidden multiple-choice question and manipulate it with JavaScript - that can only be done in group-by-group mode.
An alternate solution for your problem would be to have several versions of Q2 and show the appropriate one via relevance.
An alternate solution for your problem would be to have several versions of Q2 and show the appropriate one via relevance.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
6 years 6 months ago #158282
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Hide a ListRadio option based on the answer to previous ListRadio question.
If the survey is in Question by Question mode you need 2 question to filter another one
1. An hidden multiple choice question
2. A Equation hidden question
The idea is to set the value of the multiple choice according to the value of the equation.
For example,
1. An hidden multiple choice question
2. A Equation hidden question
The idea is to set the value of the multiple choice according to the value of the equation.
For example,
Code:
{M_A1=if(Q1.NAOK=="A1","Y","")} {M_A2=if(Q1.NAOK=="A2","Y","")}
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
6 years 6 months ago #158284
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 Hide a ListRadio option based on the answer to previous ListRadio question.
But...how do you hide them? If they are hidden via question setting, they are never rendered so can't be manipulated (at least that's my understanding). If hidden via CSS, you will have blank screens.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
6 years 6 months ago #158288
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Hide a ListRadio option based on the answer to previous ListRadio question.
M and the equation are hidden, Q2 use M as array_filter
In demonstration.sondages.pro/676785 MULTIPLE2 and SETMULTIPLE2 can be hidden (totally hidden, no js/css hidden). You can check what you want in MULTIPLE2, it resetted when you move next :)
In demonstration.sondages.pro/676785 MULTIPLE2 and SETMULTIPLE2 can be hidden (totally hidden, no js/css hidden). You can check what you want in MULTIPLE2, it resetted when you move next :)
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.