need JS to hide dropdown options in side-by-side matrix for one of the statements | XM Community
Skip to main content

This is my Q2 in the Qualtrics survey instrument in which I have a side-by-side table with 4 statements and 2 columns with dropdown options. For statements 2 and 3, I want to hide dropdown options for both columns.

 

Qualtrics.SurveyEngine.addOnReady(function () {
const quest = this;
const qc = quest.getQuestionContainer();

const allRows = qc.querySelectorAll(".Choice");

allRows[1].querySelectorAll("select").forEach((dd) => {
dd.disabled = true;
dd.style.opacity = 0;
});
});

 


thanks @ahmedA . This JS is working perfect. However, I realized that, for statement 2, I would like to hide the dropdown options from the first column and not the second one. 


Qualtrics.SurveyEngine.addOnReady(function () {
const quest = this;
const qc = quest.getQuestionContainer();

const allRows = qc.querySelectorAll(".Choice");

const dropDowns = allRows[1].querySelectorAll("select");

dropDowns[0].disabled = true;
dropDowns[0].style.opacity = 0;
});

 


Leave a Reply