Phone number validation in order form

WPPizza – A Restaurant Plugin for WordPress Support Feature Requests Phone number validation in order form

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #16295
    eggdelight
    Participant

      Hi,

      First of all, thank you developers for this great app. I am trying to add this plugin in one of the website ‘www.egg-delight.com’. This plugin is just great to work with. We are currently is testing phase and when we were trying to place order, the phone number is not validated. For example if I put phone number as ‘00000000000000000000’, it is also accepted. Can we have this validation?

      #16297
      Olly
      Admin & Mod

        there is no way to add some phonenumber validation into the plugin itself that would work for all countries, or – more accurately – if one were to have validation that would take account of the number formatting possible in all countries, it would be pretty useless.

        I’m afraid you will have to add that yourself depending on where you are

        just a quick search comes up with lots of examples

        https://www.google.co.uk/?gws_rd=ssl#q=jquery+validation+phone+number

        NOTE: the plugin automatically uses/adds the jquery validation plugin (http://jqueryvalidation.org) so you can build/add something on that basis if you want

        #16298
        Olly
        Admin & Mod

          mind you, *perhaps* i could add some field in the order form settings that would let you add a regex for validation with some default validation pattern and optionally your own , but i fear this would go over most peoples heads.

          i’ll mull it over, but won’t be before v3.0 at the earliest

          #16299
          eggdelight
          Participant

            Thank you Olly, I will try to add it.. I am new to wordpress file structure.. If you can help to know where I can update it.. I will do some research and do it.

            #16300
            eggdelight
            Participant

              Thank you, adding regex would be great. But I need this to be done earliest, I probably will do it on my own. I just need to know the file name where I can add validations.

              #16301
              Olly
              Admin & Mod

                >I just need to know the file name where I can add validations.

                you have to add your own , or put it in the page via some action
                see here for a bunch of examples

                http://wordpress.stackexchange.com/questions/33008/how-to-add-a-javascript-snippet-to-the-footer-that-requires-jquery

                perhaps adding a conditional like

                
                global $post;
                if($post->ID == /*id of your orderpage */){
                echo the validation.....etc etc
                }
                

                so it only gets included on the actual order page

                #16302
                eggdelight
                Participant

                  Thank you so much, ‘Using id of orderpage’.. This is what I needed to know.. I will take care of the validation..

                  #16303
                  Olly
                  Admin & Mod

                    glad i could help

                  Viewing 8 posts - 1 through 8 (of 8 total)
                  • The topic ‘Phone number validation in order form’ is closed to new replies.