Drop Down List | XM Community
Question

Drop Down List

  • 11 August 2020
  • 2 replies
  • 4 views

I have the following code for a drop down list used in a different form that is being converted to Qualtrics. I created a drop down list. How can I convert code to work for Qualtics? Any help is appreciated!


2 replies

Userlevel 7
Badge +22

Put the above HTML code in the the HTML view of the descriptive question.
Create two embedded data in the survey flow as the first element in the survey flow - "SelValue","SelText".
Paste the below code in the JS of the descriptive question under onReady function:
jQuery("#NextButton").on('click',function(){

var v = jQuery(".transform").find("option:selected").val();
var t = jQuery(".transform").find("option:selected").text();

Qualtrics.SurveyEngine.setEmbeddedData("SelValue", v);
Qualtrics.SurveyEngine.setEmbeddedData("SelText", t);

});


Thanks for the help! Works great!

Leave a Reply