<html>
<head>
<script type="text/javascript">
function chkstr()
{
var Eml1=document.getElementById("eml1").value;
var Eml2=document.getElementById("eml2").value;
if(Eml1 != Eml2) {
alert("Email addresses don't match.");
return false;
}
}
</script>
</head>
<body>
<h1>js-strcmp.html</h1>
<form action="#" method="get" onsubmit="return chkstr();">
<input type="text" name="eml1" id="eml1" value="Email 1" /><br />
<input type="text" name="eml2" id="eml2" value="Email 2" /><br />
<input type="submit" value="Submit" />
</form>
</body>
</html>
|