﻿function ContactUs_Form_Validator(theForm)
{
if (theForm.ContactName.value == "")
{
alert("Please enter a value for the \"Contact Name\" field.");
theForm.ContactName.focus();
return (false);
}
if (theForm.ContactName.value.length < 2)
{
alert("Please enter at least 2 characters in the \"Contact Name\" field.");
theForm.ContactName.focus();
return (false);
}
if (theForm.ContactName.value.length > 100)
{
alert("Please enter at most 100 characters in the \"Contact Name\" field.");
theForm.ContactName.focus();
return (false);
}
if (theForm.EMail.value == "")
{
alert("Please enter a value for the \"E-mail\" field.");
theForm.EMail.focus();
return (false);
}
if (theForm.EMail.value.length < 2)
{
alert("Please enter at least 2 characters in the \"E-mail\" field.");
theForm.EMail.focus();
return (false);
}
if (theForm.EMail.value.length > 100)
{
alert("Please enter at most 100 characters in the \"E-mail\" field.");
theForm.EMail.focus();
return (false);
}
if (theForm.Comments.value == "")
{
alert("Please enter a value for the \"Comments\" field.");
theForm.Comments.focus();
return (false);
}
if (theForm.Comments.value.length < 2)
{
alert("Please enter at least 2 characters in the \"Comments\" field.");
theForm.Comments.focus();
return (false);
}
if (theForm.Comments.value.length > 1000)
{
alert("Please enter at most 1000 characters in the \"Comments\" field.");
theForm.Comments.focus();
return (false);
}
return (true);
}

