Email Address Validate : Form Validation « Form Control « JavaScript DHTML






Email Address Validate

  
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
<!--

function validateEmail(){
 var email_add=window.prompt("What is your e-mail address?","");
 if (email_add.indexOf("@") == -1) {
    window.alert("You need an '@' symbol in your address, please try again.");
 }
 
 if (email_add.indexOf(".") == -1){
    window.alert("You need a '.' symbol in your address, please try again.");
 }
 
 if ( (email_add.indexOf("@") != -1) && (email_add.indexOf(".") != -1) ){
    window.alert("Thanks!");
 }
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT type="button" value="Click to enter an e-mail address" onClick="validateEmail();">
</BODY>

</HTML>

           
         
    
  








Related examples in the same category

1.Form Validator: time, date email, phone number, age etc
2.Form Validate: is blank, is digit and is integer
3.Log in form validation
4.Log in email validation
5.Comprehensive form validation
6.Illegal sub string validation
7.Email form validation
8.Form Validator
9.Form valiation for empty data, file name
10.Time Validate
11.URL Validate
12.Use JavaScript to check the password input
13.Form value validation and onsubmit action
14.Check form input value and alert user by change the control background