Email Address Validate : Form Validation : Form Control : JavaScript DHTML examples (example source code) Organized by topic

JavaScript DHTML
C++
PHP
JavaScript DHTML Home »  Form Control   » [  Form Validation  ]   
 



Email Address Validate

Please note that some example is only working under IE or Firefox.

/*
JavaScript: A Beginner's Guide, Second Edition
By John Pollock

Publisher: McGraw-Hill, 

Published December 2003, 550 pages, 
ISBN 0072227907
*/

<HTML>

<HEAD>

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

function get_add(){
 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="get_add();">
</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








Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.