mw2005
08-25-2005, 07:10 PM
Hi all;
I have a form and it checks to see if both email enteries are correct. I used document.write to display if the emails are not the same but it opens in a different page. If there is an error how can i display it next to the email fields.
Any help will be appreciated,
Thanks in Advance,
MW2005
<script Language="JavaScript">
<!--
function Validate(contactform)
{
// check if both password fields are the same
if (contactform.mail.value != contactform.verifymail.value)
{
document.write("The two emails are not the same.");
contactform.verifymail.focus();
return (false);
}
return (true);
}
//-->
</script>
<form action="" method="POST" onsubmit="return Validate(this)" name="Form">
email:
<input type="text" size="10" name="mail">
Verify email:
<input type="text" size="10" name="verifymail"><br><p>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Reset"><p>
</form>
I have a form and it checks to see if both email enteries are correct. I used document.write to display if the emails are not the same but it opens in a different page. If there is an error how can i display it next to the email fields.
Any help will be appreciated,
Thanks in Advance,
MW2005
<script Language="JavaScript">
<!--
function Validate(contactform)
{
// check if both password fields are the same
if (contactform.mail.value != contactform.verifymail.value)
{
document.write("The two emails are not the same.");
contactform.verifymail.focus();
return (false);
}
return (true);
}
//-->
</script>
<form action="" method="POST" onsubmit="return Validate(this)" name="Form">
email:
<input type="text" size="10" name="mail">
Verify email:
<input type="text" size="10" name="verifymail"><br><p>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Reset"><p>
</form>