Solved
remove prefilled 0 from constant sum. save user filled answer so user can review answer.
I need to remove the prefilled 0 from the constant sum question type. This is easy to do with:
jQuery("#"+this.questionId+" li input[type=text]").val("");
However, if a user comes back to review their answer, the box appears to have lost its value. Another question on this forum suggests this code that will retain the value and show it to the user:
var inputs = jQuery("#"+this.questionId+" .SumInput input");
if(inputs.filter(function() {return this.value != "0";}).length == 0) {
inputs.val("");
}
This is great for retaining the value but still shows a default 0 and stores a 0 in the data even if the user did not actually enter a 0.
I want to:
1. remove the display of the prefilled 0.
2. Retain the value of what the user entered, including if it is a 0.
3. do not submit a default value of 0 when the user has not interacted with the question.
Is this possible? Thanks in advance for your help
Best answer by TomG
> @deanx032 said:
> Here is a sample with two questions. The first uses constant sum vertical text with total. the second uses constant sum vertical text. The one with the total works great. The one that does not use the total shows up with a prefilled 0, but works otherwise. If I could get the prefilled 0 removed there, it would be perfect for what I need.
>
> https://umn.qualtrics.com/jfe/form/SV_bQmLsQy7GYz0XWJ
For a constant sum without a Total Box, change the selector on the first line of code:
```
var inputs = jQuery("#"+this.questionId+" input.SumInput");
```
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
