I have seen solutions for a regular matrix table. How do you do this on a drop down matrix table?
Hiding scale points in a drop-down randomized matrix table
Best answer by vgayraud
Hi,
You can try this function.
Qualtrics.SurveyEngine.addOnReady(function () {
var that = this;
function hideDropdownItems(itemsToHide) {
// Detect layout and select appropriate dropdown structure
var questionRoot = document.querySelector('#question-' + that.questionId)
|| document.querySelector('#' + that.questionId);
if (!questionRoot) return;
var dropdownItems = questionRoot.querySelectorAll('li.menu-item');
var isCustomStructure = dropdownItems.length > 0;
if (!isCustomStructure) {
dropdownItems = questionRoot.querySelectorAll('select');
}
// New Survey Taking Experience with dropdowns using <li.menu-item>
if (isCustomStructure) {
for (var i = 0; i < dropdownItems.length; i++) {
var item = dropdownItems[i];
var id = item.id;
if (!id || !id.startsWith('menu-item-')) continue;
var parts = id.split('-'); // "menu-item-1-2"
if (parts.length < 4) continue;
var statementNum = parts[2];
var scaleNum = parts[3];
for (var j = 0; j < itemsToHide.length; j++) {
var rule = itemsToHide[j];
if (rule[0] === statementNum && rule[1] === scaleNum) {
item.style.display = 'none';
break;
}
}
}
}
// Legacy layouts with <select> structure
else {
for (var i = 0; i < dropdownItems.length; i++) {
var select = dropdownItems[i];
var selectId = select.id; // e.g., QR~QID1~2
var idParts = selectId.split('~');
if (idParts.length < 3) continue;
var statementNum = idParts[2];
var options = select.querySelectorAll('option');
for (var j = 0; j < options.length; j++) {
var option = options[j];
var scaleNum = option.value;
if (!scaleNum) continue;
for (var k = 0; k < itemsToHide.length; k++) {
var rule = itemsToHide[k];
if (rule[0] === statementNum && rule[1] === scaleNum) {
option.hidden = true;
break;
}
}
}
}
}
}
// [statementNum, scalePointNum] you want to hide
var itemsToHide = [
["1", "2"],
["2", "3"],
["3", "1"]
];
hideDropdownItems(itemsToHide);
});
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

