//if the onsubmit value is returned false then the form will NOT submit
<FORM ACTION="website.php" NAME="testform" onSubmit="return TestDataCheck()">
</form>
<SCRIPT TYPE="text/javascript">
function TestDataCheck()
{
if ( (qtytested >= 1) && (qtypassed >= 0) && (qtytested >= qtypassed))
returnval = true;
else
{
alert("must enter the quantity tested and that amount or fewer for quantity passed");
returnval = false;
}
</SCRIPT>
<form action="post.php" method="post" name="myForm" onsubmit="return validateMyForm()">
<script type="text/javascript" language="javascript">
function validateMyForm()
{
if (document.myForm.first_name.value == '') {
alert('Please enter your first name');
document.myForm.first_name.focus();
return false;
}