function FormName_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("You must enter a name.");
theForm.Name.focus();
return (false);
}

// require at least 3 characters be entered
if (theForm.Name.value.length < 3)
{
alert("Please enter at least 3 characters in the \"Name\" field.");
theForm.Name.focus();
return (false);
}

// allow ONLY alphanumeric keys, no symbols or punctuation
// this can be altered for any "checkOK" string you desire
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ";
var checkStr = theForm.Name.value;
var allValid = true;
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 (!allValid)
{
alert("Please enter only letters in the \"Name\" field.");
theForm.Name.focus();
return (false);
}

// check if telephone field is blank
if (theForm.Telephone.value == "")
{
alert("Please enter your telephone number in the \"Telephone\" field.");
theForm.Telephone.focus();
return (false);
}

// only allow numbers to be entered
var checkOK = "0123456789()- ";
var checkStr = theForm.Telephone.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 your telephone number in the \"Telephone\" field.");
theForm.Telephone.focus();
return (false);
}

return (true);
}