File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Validating phone number and email in form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Validating phone number and email in form" Watch "Validating phone number and email in form" New topic
Author

Validating phone number and email in form

Dan Grindstaff
Ranch Hand

Joined: Sep 24, 2006
Posts: 138
I have a form with phone number and email fields that need some validation scripting. I need to make sure the user enters the phone number and email correctly, i.e. 10 digit phone number, no alphas, and check for '@' and '.' in the email entry. Any ideas would be greatly appreciated. Thanks in advance.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
The great thing about JavaScript is people already did stuff for you if you know how to find it. Google is a big help:

Email Validation: http://www.google.com/search?q=JavaScript+email+validation
Phone validation: http://www.google.com/search?q=JavaScript+phone+number+validation

just remember that you need to validate on the server and also foreign phone numbers are not 10 numbers long. [if you care about international stuff]

Eric
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Validating phone number and email in form
 
Similar Threads
Validating email and phone number using java
multiple forms
Enthuware's Mock Exams and My telephone number
To the author
AJAX and simple form validation