Pass a drop-down value to drill-down questions ahead | XM Community
Skip to main content

Hi Experts,
I have a survey which asks for Country drop-down selection at Q-2.
This country value is needed into further 2 drill-down questions to pre-fill what was selected in Question-2.
I tried multiple JS codes from other threads but could not succeed.
Example: [tried with val and text both]

  1. jQuery("#"+this.questionId+" select").find("option:eq(0)").text("${q://QID2/ChoiceGroup/SelectedChoices}").prop({"disabled":true,"selected":true});

  2. var selects = jQuery("#"+this.questionId+" select"); selects.eq(0).val("${q://QID2/ChoiceGroup/SelectedChoices}");

Can someone please help with what the JS code should look like and in which event OnLoad/OnReady ?
Thanks - Naro

Hi Naro_BT,
if understand your requirement correctly you have three questions with the same answer categories.
if the respondent selected category 2 in the first question, then category 2 should be preselected in question 2; if the respondents selects category 4 and category 7 in the second question the respondent has in question 2 category 2, category 4 and 7 selected. These three categories should then be preselected in question 3?
Best regards
Rudi



Thanks for a response Rudi ,
Yes.
The first question is a simple drop-down with countries selection.
The selected value needs to be used in drill-down questions which have country combination in it - since each country have specific values and need to show only those choices.
Once we have the country passed onto the drill downs the choices will be limited to choose and simplify survey taking. If not they will keep choosing countries in the next two drill-down questions even after filling the answer at the beginning.
Hope this gives more clarity!
Regards - Naro


Hi Naro, i’m dealing with similar problem. Did you solve the problem?


Leave a Reply