Form Validator

<script Language="JavaScript">
function FormValidator(theForm){
if (theForm.Name.value==""){
alert("Please enter your name.");
theForm.Name.focus();
return (false);
}
if (theForm.Subject.value==""){
alert("Please enter the subject");
theForm.Subject.focus();
return (false);
}
return (true);
}
</script>

<form method="POST" action="add.php" onsubmit="return FormValidator(this)" name="FormName">
<p>
Name : <input type="text" name="Name" size="20"><br>
Subject : <input type="text" name="Subject" size="20"><br>

<input type="submit" value="Submit" name="Submit"> <input type="reset" value="Reset" name="Reset">
</p>
</form>