Adding a color swatch question | XM Community
Skip to main content

Hello, does anyone know how to add a question where the respondent can choose a color option from a color swatch? Thanks all! 

If you’re wanting them to select a color from a picture of a color swatch, you could try using the heat map question type. Instructions here: https://www.qualtrics.com/support/survey-platform/survey-module/editing-questions/question-types-guide/specialty-questions/heat-map/


@daiello10 Make a Text Entry question and add this JavaScript into it

Qualtrics.SurveyEngine.addOnload(function() {
var questionId = this.questionId;
var inputElement = document.querySelector(""id='QR~" + questionId + "']");

if (inputElement) {
inputElement.type = "color";
inputElement.value = "#ff0000";
inputElement.style.outline = "none";
}
});

This should give you the Color Picker

Your answer will be save in HEX
Let me know if this helps


Leave a Reply