The best way to do a form validation is not to even leave the page at all. You do this by using javascript. Here is the code:
<script language="JavaScript">
<!--
function formCheck(form)
{
if (form.firstname.value == "")
{
alert("Please include your first name.")
return false;
}
if (form.lastname.value == "")
{
alert("Please include your last name.")
return false;
}
if (form.city.value == "")
{
alert("Please include the city you live in.");
return false;
}
if (form.state.value == "")
{
alert("Please include the state you live in.");
return false;
}
if (form.email.value == "")
{
alert("Please an email address.");
return false;
}
}
//-->
</script>
firstname, lastname, etc....are all names in the field. You can add more if statements if needed. Then, for the submit button, use this code:
<input type="submit" value="submit" onSubmit="return formCheck(form)">