Filter answers based on single-choice answer?

More
3 years 3 months ago #112142 by mikeu
mikeu created the topic: Filter answers based on single-choice answer?
I am trying to create a question whose valid/displayed responses depend on the selected answer from a previous drop-down list. Is this possible?

As a very simplified example, suppose I ask Q1 "In which country do you live?" and have a drop-down list with answers Germany and France.

Then I want the next question to be "What is your favourite city in {country}?", and set things up so that if the respondent answered Q1 with Germany, they can answer Q2 from a drop-down list with Berlin, Munich, or Frankfurt, but if they answered Q1 with France, then they can select instead Paris, Nice, or Marseille.

Whatever answers they select, I want to end up with a single value for {country} and one for {city}. The only methods I've found so far would be either to use relevance equations on many secondary questions to come up with e.g. {city_de}, {city_fr}, or possibly to use a multiple choice question for Q1, with a validation rule that makes sure exactly one country is selected. Neither of these options seems great to me.

Is there another method that I've missed so far?

Please Log in to join the conversation.

More
3 years 3 months ago #112151 by tpartner
tpartner replied the topic: Filter answers based on single-choice answer?
There have been many discussions in the forum about filtering dropdown answers by previous question(s), and, while it is possible with JavaScript, my thinking is that the simplest route is several secondary questions controlled with 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
3 years 3 months ago #112152 by Ben_V
Ben_V replied the topic: Filter answers based on single-choice answer?
Some of those discussions:
approach #1
and
approach #2

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)

Please Log in to join the conversation.

More
3 years 3 months ago #112158 by mikeu
mikeu replied the topic: Filter answers based on single-choice answer?
Thank you both for your replies. I unfortunately won't have time to work through them for a couple of hours yet, but I wanted to ask a follow up in case it turns out I don't need to.

Does the solution still require these JavaScript work-arounds if the second question is an array of radio buttons instead of a drop-down?

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!