My javascript works, the only issue is that it only works when first going back to the page that has the questions and then press next again.
Each script is set to one question that has javascript. All QID questions are on one page, the survey also goes automatically to the next page after selecting an option for each multiple choice (single choice) question.
Qualtrics.SurveyEngine.addOnPageSubmit(function () {
var answer = "${q://QID212/ChoiceGroup/SelectedChoices}";
if (answer == 'Kromstraat 72/72a' || answer == 'Logeerboerderij') {
Qualtrics.SurveyEngine.setEmbeddedData('Filter2_Logeren', answer);
Qualtrics.SurveyEngine.setEmbeddedData('Filter16', 'Zelf doen');
}
});
Qualtrics.SurveyEngine.addOnPageSubmit(function () {
var answer = "${q://QID250/ChoiceGroup/SelectedChoices}";
if (answer == 'Ja') {
Qualtrics.SurveyEngine.setEmbeddedData('Filter2_NSO', 'Xieje');
Qualtrics.SurveyEngine.setEmbeddedData('Filter16', 'Zelf doen');
}
});
Qualtrics.SurveyEngine.addOnPageSubmit(function () {
var answer = "${q://QID252/ChoiceGroup/SelectedChoices}";
if (answer == 'Ja') {
Qualtrics.SurveyEngine.setEmbeddedData('Filter2_KDC', 'KDC');
Qualtrics.SurveyEngine.setEmbeddedData('Filter16', 'Zelf doen');
}
});
This is then found on the next page, but all are empty, unless I go back on the page and forward again..
Filter2_Logeren : ${e://Field/Filter2_Logeren}
Filter2_NSO : ${e://Field/Filter2_NSO}
Filter2_KDC : ${e://Field/Filter2_KDC}
Vul Filter16 - Ondersteuningsprogramma: ${e://Field/Filter16}
Thanks in advance!