Jquery/Javascript to uncheck all items in a matrix question | XM Community
Skip to main content

I will say my jQuery/JavaScript is rusty, but the Qualtrics naming and usage has me stumped. I have a two-column matrix question that allows the R to select one or both. I am being asked to create a second question with a check box that (if checked) would uncheck all of the entries in matrix.
Q1 Visited Stayed
Park 1 ___ ___
Park 2 ___ ___
Park 3 ___ ___

Q2
___ I did not visit or stay in any of these parks

Normally, I would put this in the matrix, but the request is to split it out. In the JavaScript for Q2: How do I reference (and set) the boxes accordingly? Is there a best practice for this type of situation? Any sample code would be appreciated.

Yes, we need to add two click events, one for each question's (Matrix and multi select question) checkboxes. Check the demo here.


rondev - Hmm. I was actually looking for code that would do this.


I was able to figure it out. It didn't appear that the checkbox below the matrix was able to use the prop. Using .jQuery('QR~QIDn-1').prop('checked', false);  worked.


Leave a Reply