I have a Constant Sum question that appears on the same page as several other questions, and I would like to remove the prefilled zeros from the Constant Sum to not bias respondents. I'm currently using the below JavaScript:
Qualtrics.SurveyEngine.addOnload(function()
{
var inputs = $(this.questionContainer).select("input");
inputs.each(function (input) {
if (input.value == 0) {
input.value = "";
}
});
});
The issue is that if the respondent enters a zero as an actual answer and then later fails validation on the same screen, the Javascript removes that manually entered zero, leading the respondent to have to enter it again. This is a confusing respondent experience, so my question is, is there a way to improve this JavaScript so that it only removes the prefilled zeros the first time the page loads, and then doesn't do it again?
(As a note, I have seen this post in the community already: https://www.qualtrics.com/community/discussion/2531/constant-sum-without-prefilled-0. The JavaScript given there has the same problem as mine though.)
Best answer by Anonymous
View original