I have my form validation working, but when I test it by leaving a required filed blank, it still sends the email. Not too sure where I missed up, because my error console hasnt picked up any errors.





Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contact</title>
<link href="style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
function ValidateContactForm()
{
if (document.getElementById("text").value === "") 
{
	window.alert("Please provide a detailed description or comment.");
	document.getElementById("text").focus();
	}
if (document.getElementById("author").value === "")
{
	window.alert("Please provide your name.");
	document.getElementById("author").focus();
}
if (document.getElementById("verif_box").value === "")
{
	window.alert("Please enter captcha code.");
	document.getElementById("verif_box").focus();
}

if 

(!(/^([a-z0-9])([\w\.\-\+])+([a-z0-9])\@(([\w\-]?)+\.)+([a-z]{2,4})$/i.test(emailAddress.val

ue))) {
	window.alert("Please enter a valid email address.");
	document.getElementById("email").focus();
}
return false;
}

</script>
</head>
<body>