WPPizza – A Restaurant Plugin for WordPress › Support › General Support › Make form field numeric only
- AuthorPosts
- 3 January, 2017 at 7:18 pm #24472
Hi Olly,
On the Orders page I have the Telephone field as “required”. However, if the customer enters “no phone” it accepts it as valid. I would like to force this field to accept numeric input only.
Essentially I want to add an attribute of type=”numbers” to the <input> tag with the name/id of “ctel”.
I use the Divi theme but can’t see any way to override this statement.
Thanks!
4 January, 2017 at 1:19 pm #24501at the moment, you would have to edit the template or write your own js validation for whatever kind of validation you need for those fields
that said, if someone has no phone, he/she will just type in a fake number , i don’t think you will be able to use the validation for making sure you have a phonenumber that exists …
PS: version 3 will have a number of (infinitely extendable) validation options for those fields inbuilt. just thought i’d mention it
4 January, 2017 at 1:39 pm #24502That’s pretty much what I figured, Olly. My client always calls back for confirmation, so I’ll just modify the text in the form to say that orders will not be processed if the phone number isn’t valid.
Thanks!
4 January, 2017 at 1:57 pm #24503that would probably be a good workaround and the only way I can see to really validate a phonenumber in any case
4 January, 2017 at 2:04 pm #24504Agreed.
- AuthorPosts
- The topic ‘Make form field numeric only’ is closed to new replies.