Javascript not working on a dropdown menu | XM Community
Question

Javascript not working on a dropdown menu

  • 18 February 2020
  • 0 replies
  • 5 views

Userlevel 1
Badge
Hello,

I am trying to set embedded data based on a dropdown selection and it is not working.

Here is my code

Qualtrics.SurveyEngine.addOnload(function()
{

this.questionclick = function(event,element)
{

if (element.type == 'select'){

var choiceNum = this.getChoiceRecodeValue(element.id.split('~')[2]);
}

if (choiceNum == 01) {

Qualtrics.SurveyEngine.setEmbeddedData('ClassComp','True');

}

else if (choiceNum == 04) {

Qualtrics.SurveyEngine.setEmbeddedData('ClassComp','True');

}

I don't get an error but it doesn't do anything either. Ive recoded each answer but nothing seems to work. What am I missing?

0 replies

Be the first to reply!

Leave a Reply