
<!--
function 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

// check to see if the field is blank
if (theForm.first_name.value == "")
{
alertsay = "Please fill in the following field" + "\n"
alertsay = alertsay + "First Name"
alert(alertsay);
theForm.first_name.focus();
return (false);
}

// check to see if the field is blank
if (theForm.last_name.value == "")
{
alertsay = "Please fill in the following field" + "\n"
alertsay = alertsay + "Last Name"
alert(alertsay);
theForm.last_name.focus();
return (false);
}

// check to see if the field is blank
if (theForm.firm_institution.value == "")
{
alertsay = "Please fill in the following field" + "\n"
alertsay = alertsay + "Firm/Institution"
alert(alertsay);
theForm.firm_institution.focus();
return (false);
}

// check to see if the field is blank
if (theForm.street_1.value == "")
{
alertsay = "Please fill in the following field" + "\n"
alertsay = alertsay + "Address"
alert(alertsay);
theForm.street_1.focus();
return (false);
}

// check to see if the field is blank
if (theForm.city.value == "")
{
alertsay = "Please fill in the following field" + "\n"
alertsay = alertsay + "City"
alert(alertsay);
theForm.city.focus();
return (false);
}

// check to see if the field is blank
if (theForm.state_province.value == "")
{
alertsay = "Please fill in the following field" + "\n"
alertsay = alertsay + "State/Province/Region"
alert(alertsay);
theForm.state_province.focus();
return (false);
}

// check to see if the field is blank
if (theForm.zip_code.value == "")
{
alertsay = "Please fill in the following field" + "\n"
alertsay = alertsay + "Zip Code"
alert(alertsay);
theForm.zip_code.focus();
return (false);
}

// check to see if the field is blank
if (theForm.country.value == "")
{
alertsay = "Please fill in the following field" + "\n"
alertsay = alertsay + "Country"
alert(alertsay);
theForm.country.focus();
return (false);
}

// Email Check -- The Hard Way
if (theForm.e_mail_address.value.length < 4)
{
alert("Please Enter Your Email Address.");
theForm.e_mail_address.focus();
return (false);
}

// check if both password fields are the same
if (theForm.e_mail_address.value != theForm.confirm_e_mail_address.value)
{
	alert("Please Make Sure Email Address Is The Same.");
	theForm.confirm_e_mail_address.focus();
	return (false);
}

// check to see if the field is blank
if (theForm.area_code.value == "")
{
alertsay = "Please fill in the following field" + "\n"
alertsay = alertsay + "Area Code"
alert(alertsay);
theForm.area_code.focus();
return (false);
}

// check to see if the field is blank
if (theForm.phone_number.value == "")
{
alertsay = "Please fill in the following field" + "\n"
alertsay = alertsay + "Phone Number"
alert(alertsay);
theForm.phone_number.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
//alertsay = "All questions have been answered, thank you. " + "\n"
//alertsay = alertsay + "Please click OK"
//alert(alertsay);
//return (true);
// replace the above with return(true); if you have a valid form to submit to
}
//-->
