NA boxes next to textboxes (text questions, form questions, constant sum questions, matrix questions) | XM Community
Skip to main content

Hi all, 

I’m designing a survey where I need to add N/A checkbox option everywhere. For the most part, they are numerical text entries or form or constant sum type questions. I’m not sure how to code script for each one such that if its selected, the textbox empties or becomes inactive. 

I tried with a matrix but couldn’t get the validation right. 

 

Please help.

Thanks!

@Justeena You can make a side-by-side question like this

And put this code in

Qualtrics.SurveyEngine.addOnload(function() {
var rows = jQuery("tr.Choice");

rows.each(function() {
var row = jQuery(this);
var dontKnowRadio = row.find("inputttype='radio']]value='1']");
var textBox = row.find("inputttype='text']");

dontKnowRadio.change(function() {
if (dontKnowRadio.is(":checked")) {

textBox.val("").prop("disabled", true).css("opacity", "0.1");
} else {

textBox.prop("disabled", false).css("opacity", "1");
}
});
});
});

 


That’s great! However - they can’t uncheck it once they select it. Does it make sense to be radio button? Is it possible to be a checkbox?


That’s great! However - they can’t uncheck it once they select it. Does it make sense to be radio button? Is it possible to be a checkbox?

You can change the second question (column) into a multi-select.  Then change ‘radio’ to ‘checkbox’ in the script.


Leave a Reply