Hiding and clearing responses in a matrix from an in-page checkbox click | Experience Community
Skip to main content
Solved

Hiding and clearing responses in a matrix from an in-page checkbox click

  • July 9, 2026
  • 2 replies
  • 18 views

Forum|alt.badge.img

Hi

I’m trying to ‘hide’ a matrix table on a preceding checkbox ‘click’ where the responses are either cleared, flushed or reset.

The matrix is a simple grid of various statements under a 5pt likert satisfaction range.

Basically, “click here if you have no experience of X”… and the following matrix table hides.

-------------

Hiding it is not the issue using either Qualtrics Display Logic or JS … but how do I also clear or reset any already-selected radio button responses in the matrix on hide?

This behaviour obviously needs to apply to the toggled list-view of the matrix as well.

Rough working JS below hides just fine, but either I have the find+prop_false line is incorrect or I’m unclear on how Qualtrics manages radio button behaviour.

Qualtrics.SurveyEngine.addOnReady(function () {

function toggleQ3() {
//QID4-1 is the ID of checkbox
//QID3 is the section ID of the question to hide/clear responses
if ($("#mc-choice-input-QID4-1").is(":checked")) {
$("#question-QID3").hide();
$("#question-QID3").find("input[type=radio]").prop("checked", false);
} else {
$("#question-QID3").show();
}
}

toggleQ3();

$("#mc-choice-input-QID4-1").on("change", toggleQ3);

});

Can anyone shed light on how to clear radio button responses on a matrix grid on-hide?

Thanks

Best answer by vgayraud

Hi,

Use the API instead of the DOM.

Qualtrics.SurveyEngine.addOnReady(function () {
function toggleQ3() {
//QID4-1 is the ID of checkbox
//QID3 is the section ID of the question to hide/clear responses
if ($("#mc-choice-input-QID4-1").is(":checked")) {
$("#question-QID3").hide();
var m = Qualtrics.SurveyEngine.QuestionData.getInstance("QID3");
var rows = m.getChoices(), cols = m.getAnswers(), i, j;
for (i = 0; i < rows.length; i++) for (j = 0; j < cols.length; j++) m.setChoiceValue(rows[i], cols[j], false);
} else {
$("#question-QID3").show();
}
}
toggleQ3();
$("#mc-choice-input-QID4-1").on("change", toggleQ3);
});

 

2 replies

vgayraud
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+65
  • QPN Level 8 ●●●●●●●●
  • Answer
  • July 9, 2026

Hi,

Use the API instead of the DOM.

Qualtrics.SurveyEngine.addOnReady(function () {
function toggleQ3() {
//QID4-1 is the ID of checkbox
//QID3 is the section ID of the question to hide/clear responses
if ($("#mc-choice-input-QID4-1").is(":checked")) {
$("#question-QID3").hide();
var m = Qualtrics.SurveyEngine.QuestionData.getInstance("QID3");
var rows = m.getChoices(), cols = m.getAnswers(), i, j;
for (i = 0; i < rows.length; i++) for (j = 0; j < cols.length; j++) m.setChoiceValue(rows[i], cols[j], false);
} else {
$("#question-QID3").show();
}
}
toggleQ3();
$("#mc-choice-input-QID4-1").on("change", toggleQ3);
});

 


Forum|alt.badge.img
  • Author
  • July 9, 2026

Fantastic Vincent, thank you very much.

I have several instances of this behaviour in this survey - that is very helpful!

Hew