I am using a very simple function validateForm(Form) on a PHP form.
<script language="javascript" type="text/javascript">
function validateForm(Form)
{
if(document.forms.Form.Name.value=="")
{
alert("Please enter your full name.");
document.forms.Form.Name.focus();
return false;
}
if(document.forms.Form.Number.value=="")
{
alert("Please enter your phone number.");
document.forms.Form.Number.focus();
return false;
}
}
</script>
triggered by
onClick="return validateForm(Form);"
This is working fine in Firefox and chrome the alert box comes up and you click ok the page does nothing till data is input, as I want it. IE8 however thinks nothing of this, the alert box comes up, click ok and the page marches on regardless.!!
?
Am I missing something?