|
|
|
18)
{
alert("Please enter at most 18 characters in the \"Add Your State\" field.");
theForm.State.focus();
return (false);
}
if (theForm.Zip.value == "")
{
alert("Please enter a value for the \"Zip\" field.");
theForm.Zip.focus();
return (false);
}
if (theForm.Zip.value.length < 5)
{
alert("Please enter at least 5 characters in the \"Zip\" field.");
theForm.Zip.focus();
return (false);
}
if (theForm.Zip.value.length > 10)
{
alert("Please enter at most 10 characters in the \"Zip\" field.");
theForm.Zip.focus();
return (false);
}
var checkOK = "0123456789- ";
var checkStr = theForm.Zip.value;
var allValid = true;
var validGroups = true;
var decPoints = 0;
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 digit characters in the \"Zip\" field.");
theForm.Zip.focus();
return (false);
}
return (true);
}
//-->
|
|