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
  • jackuars's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 6 months ago - 6 years 6 months ago #158218 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.
Last edit: 6 years 6 months ago by jackuars.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158233 by tpartner
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.
The topic has been locked.
  • jackuars
  • jackuars's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 6 months ago #158261 by jackuars
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
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158267 by tpartner
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.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158282 by DenisChenu
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,
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
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158284 by tpartner
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
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago #158288 by DenisChenu
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 , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose