N/A checkbox with form or constant sum | 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!

For a matrix multi select question we can have below custom validation: 

And then use below script in the matrix multi select question:

jQuery("#"+this.questionId+" .InputText").on('input',function(){
if(jQuery(this).val()!='') jQuery(this).closest(".ChoiceRow").find("input:checkbox").prop("checked",false);
});
jQuery("#"+this.questionId+" input:checkbox").on('change',function(){
if(jQuery(this).prop("checked"))jQuery(this).closest(".ChoiceRow").find(".InputText").val('');
});

 


Leave a Reply