Email Address Checker - This script will verify that an E-mail address is entered correctly by requiring the user to re-enter the address, checking to make sure there is no typographical error. Compatible Browsers: |
<html>
<head>
<title>Email Address Checker Javascript Code Snippet</title>
<script>
/* Begin Email Address Checker
== This Script Free To Use Providing This Notice Remains ==
== This Script Has Been Found In The https://snapbuilder.com Free Public Codes Library ==
== NOTICE: Though This Material May Have Been In A Public Depository, Certain Author Copyright Restrictions May Apply ==
== Created By: William Bontrager | http://www.willmaster.com : Creative Commons License ==
*/
function ErrorCheck() {
var formname = "myform";
var fieldwithlist = "identicalfields";
var er = new String();
var tempstring = eval("document."+formname+"."+fieldwithlist+".value");
if(tempstring.length > 1) {
var idi = tempstring.split(',');
var ts0 = eval("document."+formname+"."+idi[0]+".value");
var ts1 = eval("document."+formname+"."+idi[1]+".value");
if(ts0 != ts1) { er = 'The e-mail addresses do not match. Please re-enter them again.'; }
}
if(er.length > 0) {
alert(er);
return false;
}
return true;
}
</script>
</head>
<body>
<p>This script will verify that an E-mail address is entered correctly by requiring the user to re-enter the address, checking to make sure there is no typographical error.</p>
<form name="myform" onsubmit="return ErrorCheck();" method="post" action="">
<input type="hidden" name="identicalfields" value="email,emailagain">
<p style="width:300px; text-align:right;">E-mail<br />
<input type="text" name="email" size="22"><br />
Re-enter E-mail again<br />
<input type="text" name="emailagain" size="22"></p>
<p style="width:300px; text-align:center;"><input type="submit"></p>
</form>
</body>
</html>
|
Scroll