Source Code
<!--- Validating whether two input are equal or not
--->
<html>
<head>
<title>Equal</title>
<script LANGUAGE="JAVASCRIPT">
<!--
function onError(form_object, input_object, object_value, error_message)
{
alert(error_message);
return false;
}
function hasValue(obj1, obj_type1,obj2,obj_type2)
{
if (obj_type1 == "TEXT")
{
if (obj1.value != obj2.value)
return false;
else
return true;
}
}
function checkForm1(sthis)
{
if (!hasValue(sthis.a, "TEXT",sthis.b, "TEXT"))
{
if (!onError(sthis, sthis.a, sthis.a.value,
"Not equal"))
return false;
}
return true;
}
//-->
</script>
</head>
<body>
<form NAME="CFForm_1" onSubmit="return checkForm1(this)">
<p><input TYPE="Text" NAME="a" size="20">
<input TYPE="Text" NAME="b" size="20">
<input type="submit"> </p>
</form>
</body>
</html>