Make form field numeric only

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #24472
    fredinmexico
    Participant

      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!

      #24501
      Olly
      Admin & Mod

        at 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

        #24502
        fredinmexico
        Participant

          That’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!

          #24503
          Olly
          Admin & Mod

            that would probably be a good workaround and the only way I can see to really validate a phonenumber in any case

            #24504
            fredinmexico
            Participant

              Agreed.

            Viewing 5 posts - 1 through 5 (of 5 total)
            • The topic ‘Make form field numeric only’ is closed to new replies.