FollowThePeacemakers
Programmer
This form validation works fine on a PC but not on a Mac. Anyone know why? What can I do to fix this problem???
My friend tells me that the form action submits anyway after he clicks OK on any of my validation alerts. He tried it in both IE and NS (on a Mac).
---This is in the HEAD of the document----------
<script language="JavaScript">
<!--
function validate() {
mNv=mainform.LastName.value;
if (mNv=='') {
alert('LAST NAME is a required field. Please try again.');
event.returnValue=false;
}
}
//-->
</script>
---This is in the BODY of the document----------
<form name="mainform" action="BlahBlah.cfm" onSubmit="validate()" method="POST">
<input type="TEXT" name="LastName">
</form>
Thanks for your help!
My friend tells me that the form action submits anyway after he clicks OK on any of my validation alerts. He tried it in both IE and NS (on a Mac).
---This is in the HEAD of the document----------
<script language="JavaScript">
<!--
function validate() {
mNv=mainform.LastName.value;
if (mNv=='') {
alert('LAST NAME is a required field. Please try again.');
event.returnValue=false;
}
}
//-->
</script>
---This is in the BODY of the document----------
<form name="mainform" action="BlahBlah.cfm" onSubmit="validate()" method="POST">
<input type="TEXT" name="LastName">
</form>
Thanks for your help!