Hide a ListRadio option based on the answer to previous ListRadio question.

More
1 month 2 weeks ago - 1 month 2 weeks ago #158218 by jackuars
jackuars created the topic: Hide a ListRadio option based on the answer to previous ListRadio question.
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.
Last Edit: 1 month 2 weeks ago by jackuars.

Please Log in to join the conversation.

More
1 month 2 weeks ago #158233 by tpartner
tpartner replied the 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?

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
1 month 2 weeks ago #158261 by jackuars
jackuars replied the 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

Please Log in to join the conversation.

More
1 month 2 weeks ago #158267 by tpartner
tpartner replied the 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.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
1 month 2 weeks ago #158282 by DenisChenu
DenisChenu replied the 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,
{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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
1 month 2 weeks ago #158284 by tpartner
tpartner replied the 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.

Please Log in to join the conversation.

More
1 month 2 weeks ago #158288 by DenisChenu
DenisChenu replied the 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 :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now