How can i restrict the product quantity field to numbers only in Gravity Forms.
And how can we add some increment arrow to the quantity field?
like on this demo ? /
How can i restrict the product quantity field to numbers only in Gravity Forms.
And how can we add some increment arrow to the quantity field?
like on this demo ? http://demos.gravitywiz/gp-conditional-pricing/
Share Improve this question asked Jan 30, 2021 at 12:34 DeathByDiscoDeathByDisco 212 bronze badges2 Answers
Reset to default 0The increment arrows are inherent in <input type="number">
, your browser automatically adds them.
When you're setting up your form you just use the 'number' input rather than a 'text' input.
So instead of <input type="text" id="field_id" name="field_name" value="" />
, what you want to use is something akin to:
<input type="number" id="field_id" name="field_name" value="" step="1"/>
You can see the various attributes that can be set/specified for number inputs here:
https://www.w3schools/tags/att_input_type_number.asp
Thanks to David from Gravity Wiz.
He gave me the hint that i just need to enabled HTML5 on the Gravity Forms global settings page.
Can't believe i missed that setting.