<!--
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.name.value == "")
{
alert("Please enter your name.");
theForm.name.focus();
return (false);
}

// require at least 3 characters be entered
if (theForm.name.value.length < 3)
{
alert("Please enter a full name.");
theForm.name.focus();
return (false);
}


// check to see if the field is blank
if (theForm.title.value == "")
{
alert("Please enter your title.");
theForm.title.focus();
return (false);
}

// check to see if the telephone field is blank
if (theForm.contact.value == "")
{
alert("Please enter a telephone number.");
theForm.contact.focus();
return (false);
}

// require at least 4 numbers
if (theForm.contact.value.length < 4)
{
alert("Please enter at least four digits for a telephone number.");
theForm.contact.focus();
return (false);
}

// cannot be greater than 8 numbers
if (theForm.contact.value.length > 8)
{
alert("Please re-enter your telephone number.");
theForm.contact.focus();
return (false);
}

// only allow numbers to be entered
var checkOK = "0123456789-";
var checkStr = theForm.contact.value;
var allValid = true;
var allNum = "";
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only digits for the telephone number.");
theForm.contact.select();
return (false);
}

// check if no drop down or first drop down is selected, if so, invalid selection
if (theForm.apt_month.selectedIndex <= 0)
{
alert("Please select a month.");
theForm.apt_month.focus();
return (false);
}

// check if no drop down or first drop down is selected, if so, invalid selection
if (theForm.apt_day.selectedIndex <= 0)
{
alert("Please select a day.");
theForm.apt_day.focus();
return (false);
}

// check if no drop down or first drop down is selected, if so, invalid selection
if (theForm.apt_year.selectedIndex <= 0)
{
alert("Please select a year.");
theForm.apt_year.focus();
return (false);
}

// require at least one radio button be selected
var radioSelected = false;
for (i = 0;  i < theForm.health.length;  i++)
{
if (theForm.health[i].checked)
radioSelected = true;
}
if (!radioSelected)
{
alert("Please select one of the \"Health Insurance\" options.");
return (false);
}


// require at least one radio button be selected
var radioSelected = false;
for (i = 0;  i < theForm.retire.length;  i++)
{
if (theForm.retire[i].checked)
radioSelected = true;
}
if (!radioSelected)
{
alert("Please select one of the \"Retirement Plan\" options.");
return (false);
}

// registration number cannot exceed 9 characters
if (theForm.ret_number.value.length > 9)
{
alert("Your membership number\nmay not exceed 9 characters.");
theForm.ret_number.focus();
return (false);
}


// alert if the box is NOT checked
if (!theForm.uup_enroll.checked)
{
alertsay = "You did not check the UUP Enrollment card box."
alertsay = alertsay + "\nYou must complete this card to enroll."
alert(alertsay);
theForm.uup_enroll.focus();
return (false);
}

return (true);
}
//-->