Hey!
I want to show respondents a Highlight Question they already answered again, but also display them with the selection they made the first time to reconsider them. Is there a way to have a default category selection in a highlight question in Qualtrics? My hunch was to extract the first selection and have a JavaScript to highlight the selection again. My current JavaScript (below) is not working:
var questionID = 'QID273';
// Replace 'Option1', 'Option2', etc. with the values of the options you want to select by default
var defaultOptions = "${q://QID39/ChoiceGroup/SelectedChoicesForAnswer/1}";
// Get the question element
var questionEl = this.getQuestionContainer();
// Loop through each default option
defaultOptions.forEach(function(optionValue) {
// Find the checkbox corresponding to the default option
var defaultOption = questionEl.querySelector('labelafor="' + questionID + '_' + optionValue + '"]');
// If the default option exists, select it
if (defaultOption) {
defaultOption.click(); // Click the label to select the checkbox
}
});
Any help is greatly appreciated! Thanks in advance!