Uncheck radio button in side by side SBS question | Experience Community
Skip to main content

Uncheck radio button in side by side SBS question

  • June 4, 2026
  • 1 reply
  • 23 views

Forum|alt.badge.img+2

Is there a way to unselect radio button in a side by side question.

 

I have the following code but it only works for simple multiple select and matrix.

Qualtrics.SurveyEngine.addOnload(function() {
qobj = this;
jQuery(qobj.questionContainer).find("input[type=radio]").click(function() {
var [qr, qid, cid, aid] = this.id.split("~");
if(qobj.getSelectedAnswerValue(cid)==aid) qobj.setChoiceAnswerValue(cid,aid,false);
});
});

 

1 reply

nikamshubham73
Level 3 ●●●
Forum|alt.badge.img+4
  • Level 3 ●●●
  • July 15, 2026

Hi ​@mugheeshay,

Please try the below code for the Side by side question type, hope it helps!

Qualtrics.SurveyEngine.addOnReady(function() {

// Find EVERY radio button inside this specific question
var $radios = jQuery(this.questionContainer).find("input[type='radio']");

// Loop through each radio button and apply our React Hack
$radios.each(function() {

var radioEl = this; // The raw HTML input element
var parentTd = radioEl.closest("td"); // The table cell holding the bubble

if (!parentTd) return; // Safety check

// 1. Record if it is checked the exact moment the mouse clicks DOWN
jQuery(parentTd).on("mousedown", function() {
jQuery(radioEl).data("wasChecked", radioEl.checked);
});

// 2. When the mouse click comes UP...
jQuery(parentTd).on("mouseup", function() {

// If it was ALREADY checked when they clicked it, we uncheck it!
if (jQuery(radioEl).data("wasChecked") === true) {

// Wait 10ms for Qualtrics to finish its normal click
setTimeout(function() {

// ==========================================
// THE CHECKBOX DISGUISE HACK
// ==========================================

// A. Disguise the radio button as a checkbox
radioEl.type = "checkbox";

// B. Force it to uncheck, and alert the React engine
var nativeSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "checked").set;
nativeSetter.call(radioEl, false);
radioEl.dispatchEvent(new Event('change', { bubbles: true }));

// C. Take the disguise off and turn it back into a radio button
radioEl.type = "radio";

// ==========================================

// D. Clean up the visual blue checkmark on the screen
jQuery(radioEl).siblings("label").removeClass("q-checked");

}, 10);
}
});
});

});