How to hide the auto-populated zeros | XM Community
Skip to main content
Solved

How to hide the auto-populated zeros


Forum|alt.badge.img+1
  • Level 1 ●
  • 4 replies

I have a Matrix/constant sum type question without the “Total” row. How do I hide the auto-populated zeros? See attached image.

I have the following JS but this does not work --

Qualtrics.SurveyEngine.addOnload(function()
{
    
/*TO HIDE THE ZEROS IN THE TEXT BOXES (DEFAULT)*/
    
    var inputs = jQuery("#"+this.questionId+" .SumInput");
    if(inputs.filter(function() {return this.value != "0";}).length == 0) {
        inputs.val("");
         }
});

 

Best answer by TomG

Try:

Qualtrics.SurveyEngine.addOnload(function() {
	var inputs = jQuery(this.questionContainer).find(".ChoiceRow td").not(".CSTotal").find("[type=text]");
	if(inputs.filter(function() {return this.value != "0";}).length == 0) inputs.val("");
});

 

View original

2 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5921 replies
  • Answer
  • March 21, 2025

Try:

Qualtrics.SurveyEngine.addOnload(function() {
	var inputs = jQuery(this.questionContainer).find(".ChoiceRow td").not(".CSTotal").find("[type=text]");
	if(inputs.filter(function() {return this.value != "0";}).length == 0) inputs.val("");
});

 


Forum|alt.badge.img+1
  • Author
  • Level 1 ●
  • 4 replies
  • March 21, 2025

Yes - that works! thank you so much Tom!


Leave a Reply