validate phone numbers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lolodede
    New Member
    • Apr 2009
    • 63

    validate phone numbers

    i have three phone numbers fields and i only need to let the user enter one of them then the form submit but if te user didnt enter any number then the submit stopped
    thanks
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    See to validate the phone number use regular expression.
    Did you read out the documentation of regular expression?

    Comment

    • lolodede
      New Member
      • Apr 2009
      • 63

      #3
      i dont want to validate phone numbers i want to alert user if he didnt put any of three contact numbers

      Comment

      • dmjpro
        Top Contributor
        • Jan 2007
        • 2476

        #4
        Show us the code what you tried so far?

        Comment

        • lolodede
          New Member
          • Apr 2009
          • 63

          #5
          i dont have any code im new to javascript thats why im asking i serached and i read two books but i cant find it
          thanks

          Comment

          • anubhavjha
            New Member
            • Jul 2008
            • 22

            #6
            try to check using if condition like
            Code:
            if(ph1.val||ph2.val||ph3.val)
            {
            //send the request;
            }
            else{//stop the request;}
            Last edited by Dormilich; Apr 13 '09, 06:58 AM. Reason: added [code] tags

            Comment

            • Dormilich
              Recognized Expert Expert
              • Aug 2008
              • 8694

              #7
              this and this tutorial seem to be a good start.

              Comment

              Working...