© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
Quick Links
Easy Studies

Validation of E-mail Address Using Java


This program is to validate email address in the JSP program using JavaScript. In most of the application there is a need to validate email address on the form. In your JSP program you can use JavaScript to validate the email address. This is also a good idea to validate the form before submitting the data to the server side program. In this example we have developed a jsp page "Checkmail.jsp" in which onSubmit="return ValidateEmail ()" of form performs the validation.

First we will check that the input field is not empty.

Then we will do the email validation using the function emailcheck (). The function emailcheck () is used to verify that the input given value is a possible valid email address. This function makes sure the email address has one "@", at least one ".". It also makes sure that there are no spaces, extra '@'s or any "." just before or after the @. It also makes sure that there is at least one "." after the @.In emailcheck () it is also checked that "@" must not to be at first place before any string and "." must not be at the first place.

Validation of E-mail Address Using Java:

<%@ page language="java" %> Email Validation

Enter an Email Address :

Sample ScreenShot:

SLogix Student Projects

⇓Student Projects⇓
⇑Student Projects⇑