Validating email using javascript

In your JSP program you can use Java Script to validate the email address.

This is also a good idea to validate the form before submitting the data to the server side used to verify that the input given value is a possible valid email address.

Here is the code to validate email address in Java Script using regular expression.

: Finally, the email address must end with two to four alphabets.

You can leave a comment, or trackback from your own site.

In most of the application there is a need to validate email address on the form.

Having a-z and A-Z means that both lowercase and uppercase letters are allowed.

indicates the minimum and maximum number of characters.

You can follow any comments to this entry through the RSS 2.0 feed.

Learn how to validate a users email address using Java Script.

This tutorial displays a series of preset demonstrations that show different email address errors being trapped by the script.

Lets try to construct the regular expression that we will be using to check the email entered by the user. Then again any number of alphabets or numbers or ‘-’ are allowed. Finally, the ending of the email ([a-z A-Z]) $ : ^([a-z A-Z0-9])([a-z A-Z0-9\.\_\-])*@(([a-z A-Z0-9]) (\.)) ([a-z A-Z]) $ Now, lets see how to use it in the javascript.

Consider these two email id’s : [email protected] [email protected] : . We make use of the search() function of javascript.

Search for validating email using javascript:

validating email using javascript-3validating email using javascript-24validating email using javascript-28validating email using javascript-6

Java Script can check the syntax of an email address to see if the address could be correct but it cannot check the address itself to see if it actually exists.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “validating email using javascript”