<!--
function FrontPage_Form1_Validator(theForm)
{

var alertsay = ""; // define for long lines
// alertsay is not necessary for your code,
// but I need to break my lines in multiple lines
// so the code won't extend off the edge of the page
// MUST REMOVE ALL FRONTPAGE WEB-BOT VALIDATION CODE FOR THIS TO WORK PROPERLY - LYDIA

// check to see if the field is blank
if (theForm.FromName.value == "")
{
alert("Please enter your name.");
theForm.FromName.focus();
return (false);
}

// require at least 3 characters be entered
if (theForm.FromName.value.length < 3)
{
alert("Please enter at least 3 characters in the \"Name\" field.");
theForm.FromName.focus();
return (false);
}

// check if email field is blank
if (theForm.From.value == "")
{
alert("Please enter a value for the \"Email\" field.");
theForm.From.focus();
return (false);
}


// test if valid email address, must have @ and .
var checkEmail = "@.";
var checkStr = theForm.From.value;
var EmailValid = false;
var EmailAt = false;
var EmailPeriod = false;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkEmail.length;  j++)
{
if (ch == checkEmail.charAt(j) && ch == "@")
EmailAt = true;
if (ch == checkEmail.charAt(j) && ch == ".")
EmailPeriod = true;
	  if (EmailAt && EmailPeriod)
		break;
	  if (j == checkEmail.length)
		break;
	}
	// if both the @ and . were in the string
if (EmailAt && EmailPeriod)
{
		EmailValid = true
		break;
	}
}
if (!EmailValid)
{
alert("The \"email\" field must contain an \"@\" and a \".\".");
theForm.From.focus();
return (false);
}

// check to see if the field is blank
if (theForm.comments.value == "")
{
alert("Please enter your comments.");
theForm.comments.focus();
return (false);
}

// require at least 10 characters be entered
if (theForm.comments.value.length < 10)
{
alert("Please enter at least 10 characters in the \"Comments\" field.");
theForm.comments.focus();
return (false);
}

// because this is a sample page, don't allow to exit to the post action
// comes in handy when you are testing the form validations and don't
// wish to exit the page
return (true);
// replace the above with return(true); if you have a valid form to submit to
}
//-->
