Hi all,
I am trying to set an embedded data variable from the selected choices on a multiselect multiple choice question using JavaScript.
I can’t use piped text as we have a default value set at the beginning of the survey flow, and can’t set the embedded data in survey flow as we need the back button to be active.
I have the JavaScript working for the single select multiple choice question as below:
jQuery("select").on('click', function(){
var temp = jQuery("#QID59 option:selected").text();
Qualtrics.SurveyEngine.setEmbeddedData('variable', temp);
});
But this doesn’t work for my multiselect question. I have tried SO many things and nothing seems to work! This gets me the closest:
Qualtrics.SurveyEngine.setEmbeddedData('variable', "${q://QID52/ChoiceGroup/SelectedChoices}");
But for some reason you have to go back and forward between pages a couple times, which would be infuriating for the end user so is not an option.
I suspect the thing I’m missing is the correct selector/s for this question type. Can anyone help, or at least point me in the right direction?
Thanks in advance.