Constant sum without prefilled 0 | Experience Community
Skip to main content
Solved

Constant sum without prefilled 0

  • Oct 30, 2018 8:36 AM UTC
  • 3 replies
  • 385 views

Dear Community, I am looking for a way to ask which percentage of purchases was made online with an open box to enter values from 0-100. The box should be followed by the text "% online". With constant sum this text can be added, however there is always a 0 prefilled already so that respondents could just click next. If 0 is a valid value respondents can enter, is there any way to remove the prefilled 0 just showing an empty box? Or if using a text entry question, is there any way to add the "% online" on the right hand of the entry box?

Best answer by PraDeepKotian_XM

hi @cloof, Add below code in Onload function of javascript: jQuery("#"+this.questionId+" li input[type=text]").val("");
View original

3 replies

PraDeepKotian_XM
QPN Level 5 ●●●●●
Forum|alt.badge.img+21
  • QPN Level 5 ●●●●●
  • Answer
  • Oct 30, 2018 9:52 AM UTC
hi @cloof, Add below code in Onload function of javascript: jQuery("#"+this.questionId+" li input[type=text]").val("");

  • Author
  • Oct 30, 2018 9:55 AM UTC
Awesome! Thank you very much :)

  • Aug 2, 2021 10:22 AM UTC

I want to achieve exactly this, but the code does not seem to work for a constant-sum question type which uses bars instead of text fields only. How can I set up a constant sum question with bars and eliminate the pre-filled zero?