
<!--
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 if the first drop down is selected, if so, invalid selection


// 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.phone_number.value == "")
{
alertsay = "Please fill in the following field" + "\n"
alertsay = alertsay + "Phone Number"
alert(alertsay);
theForm.phone_number.focus();
return (false);
}

// check to see if the field is blank
if (theForm.email.value == "")
{
alertsay = "Please fill in the following field" + "\n"
alertsay = alertsay + "Email"
alert(alertsay);
theForm.email.focus();
return (false);
}

// require at least one radio button be selected
var radioSelected = false;
for (i = 0;  i < theForm.contact.length;  i++)
{
if (theForm.contact[i].checked)
radioSelected = true;
}
if (!radioSelected)
{
alertsay = "Please tell us your:" + "\n"
alertsay = alertsay + "Preferred Method of Contact"
alert(alertsay);
return (false);
}

// require at least one radio button be selected
var radioSelected = false;
for (i = 0;  i < theForm.groups.length;  i++)
{
if (theForm.groups[i].checked)
radioSelected = true;
}
if (!radioSelected)
{
alertsay = "Please tell us:" + "\n"
alertsay = alertsay + "May student groups contact you directly about volunteer opportunities?"
alert(alertsay);
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
}
//-->
