
function Form1_Validator(theForm1)
{

// Begin Name Required 

if (theForm1._a_Name.value == "")
{
alert("You must enter your name.");
theForm1._a_Name.focus();
return (false);
}

// End Name Required

// Begin Phone Number Required

if (theForm1._b_Phone.value == "")
{
alert("You must enter your phone number.");
theForm1._b_Phone.focus();
return (false);
}

// only allow numbers to be entered
var checkOK = "0123456789- ";
var checkStr = theForm1._b_Phone.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 numbers in the \"Phone\" field.");
theForm1._b_Phone.focus();
return (false);
}

// End Phone Number Required


}


