I am trying to pull selected choices from a multiple choice question that allows multiple selections into JavaScript. I then want to parse the choices to get each selection individually. However, when I use the suggested code for pulling selected choices into JavaScript, I am not getting any result. I have tried multiple ways of referencing selected choices, but I am still coming up with an empty array.
Qualtrics.SurveyEngine.addOnPageSubmit(function () {
var SelectedChoices = this.getSelectedChoices();
var Schools = SelectedChoices.split(', ');
var School1 = Schools[0];
var School2 = Schools[1];
var School3 = Schools[2];
Qualtrics.SurveyEngine.setEmbeddedData('School1',School1);
Qualtrics.SurveyEngine.setEmbeddedData( 'School2',School2);
Qualtrics.SurveyEngine.setEmbeddedData( 'School3',School3);
});
Thanks in advance for any ideas on what I am doing incorrectly.
Question
How to pull selected choices into Javascript
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.