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

Constant sum without prefilled 0

  • October 30, 2018
  • 3 replies
  • 299 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 ●●●●●
  • 228 replies
  • Answer
  • October 30, 2018
hi @cloof, Add below code in Onload function of javascript: jQuery("#"+this.questionId+" li input[type=text]").val("");

  • Author
  • 18 replies
  • October 30, 2018
Awesome! Thank you very much :)

  • 2 replies
  • August 2, 2021

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?


Leave a Reply