Does anyone know how to auto-close matrix, accordian-style questions in the new layout view? (There doesn’t seem to be a th[id] element.)
Thanks for any ideas!
New layout view -- accordian does not auto-close after response
Hi
In Qualtrics, the new layout view might not have a straightforward way to auto-close matrix questions with accordion-style formatting. You can give a try with JavaScript
//JavaScript//
Qualtrics.SurveyEngine.addOnload(function() {
// Function to collapse all matrix questions initially
function collapseMatrixQuestions() {
var matrixQuestions = document.querySelectorAll('.MatrixQuestion');
matrixQuestions.forEach(function(question) {
var accordionToggle = question.querySelector('.AccordionContent');
if (accordionToggle) {
accordionToggle.click(); // Simulate a click on the accordion toggle to collapse the question
}
});
}
// Call the function to collapse matrix questions on page load
collapseMatrixQuestions();
});
Thank you!
Hi,
Thanks so much for providing the script! Unfortunately, I think there’s something in this style that prevents your and my scripts from working.
I am grateful for your generosity!
Leave a Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.