最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Restricting product quantity field to numbers only in Gravity Forms

programmeradmin0浏览0评论

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 badges
Add a comment  | 

2 Answers 2

Reset to default 0

The 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.

发布评论

评论列表(0)

  1. 暂无评论