Auto-Select Matrix Table | XM Community
Skip to main content

Hi all,

I have a matrix question with two columns: one is “Tracking” and the other “Reported to Leadership”. If a person selects “Reported to Leadership” I want “Tracking” to automatically be ticked off as well. Is this possible within jQuery? I am not familiar with jQuery at all. 

If you want both columns to be mutually exclusive of each other then just use single select matrix type or if you are using multi select then just make any one column as mutually exclusive.


Hi @EthanW ,

Assuming you have below structure:

 


Add below JS code to achieve the functionality of Auto select:

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/

});

Qualtrics.SurveyEngine.addOnReady(function()
{
let que=document.getElementById(this.questionId);

let fcol=que.querySelectorAll("td.c4");

let lcol=que.querySelectorAll("td.c5");


que.addEventListener("click",function() {
for(let i=0;i<lcol.length;i++)
{

if(lcolci].childNodesd1].checked)
{

fcolci].childNodesd1].checked=true;

}


}
});

});

Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/

});

Hope this resolves your query😊!!


Leave a Reply