Default Values for Number Input field | Community
Skip to main content
Answered

Default Values for Number Input field


I need to show my form when i loads to have default values in it - so for the pizza example - you add that number to an overall price variable once someone puts a value in it..  How do I get a value into the fi\eld by default on page load?  Is that possible?

Best answer by Liz

Hi @wade Welcome to the community! It isn’t exactly possible to have default values selected, but you could use hidden fields to pass information into the forms and then recall that information in the question. Would something like this work? 

View original

3 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14919 replies
  • Answer
  • March 3, 2022

Hi @wade Welcome to the community! It isn’t exactly possible to have default values selected, but you could use hidden fields to pass information into the forms and then recall that information in the question. Would something like this work? 


  • Author
  • Explorer
  • 1 reply
  • March 3, 2022

So I can’t load a page that has 2 pizzas selected, - but if I only want 1 or 3 pizzas - I can update that field to be any other number?  Your suggestion would be to add a hidden field that has 2 in it, then load that number into the field on page load - then if the user changes that number, it would use that number now to calculate other things like price and toppings?  


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14919 replies
  • March 8, 2022

Hi @wade yes, basically that’s it! You wouldn’t be able to pass more than one value into a hidden field, so you would need to be sure that you’re only passing in one value in order for the hidden field to work. 


Reply