I am trying to remove the default display of zero from a constant sum question.
I normally use this code and it worked for questions with multiple choices.
var inputWidth = "75px";
var q = jQuery("#"+this.questionId);
q.find('.SumInput').css("width", inputWidth);
q.find('.SumTotal').css("width", inputWidth);
q.find('.InputText').css("width", inputWidth);
var inputs = jQuery("#"+this.questionId+" .SumInput input");
if(inputs.filter(function() {return this.value != "0";}).length == 0) {
inputs.val("");
}
But in this case, I only have one text box and no total box.
Solved
Removing the initial zero display on a constant sum question
Best answer by TomG
Change
jQuery("#"+this.questionId+" .SumInput input");
to
jQuery("#"+this.questionId+" .SumInput");
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.