Can anyone tell me why I keep getting this error when I try to open this page in Internet Explorer. It is an Intranet, so I can't actually give the site to view, but here is the code. The error keeps referring to line 20, I have looked through for the last 2 days and can not figure it out, any help would greatly be apprectiated.
<script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{
if (theForm.Last Name.value == "")
{
alert("Please enter a value for the \"Last Name\" field.");
theForm.Last Name.focus();
return (false);
}
if (theForm.First Name.value == "")
{
alert("Please enter a value for the \"First Name\" field.");
theForm.First Name.focus();
return (false);
}
if (theForm.Course.value == "")
{
alert("Please enter a value for the \"Course\" field.");
theForm.Course.focus();
return (false);
}
if (theForm.Vendor.selectedIndex < 0)
{
alert("Please select one of the \"Vendor\" options.");
theForm.Vendor.focus();
return (false);
}
if (theForm.Start Date.value == "")
{
alert("Please enter a value for the \"Date\" field.");
theForm.Start Date.focus();
return (false);
}
if (theForm.Start Date.value.length > 10)
{
alert("Please enter at most 10 characters in the \"Date\" field.");
theForm.Start Date.focus();
return (false);
}
if (theForm.End Date.value == "")
{
alert("Please enter a value for the \"End Date\" field.");
theForm.End Date.focus();
return (false);
}
if (theForm.End Date.value.length > 10)
{
alert("Please enter at most 10 characters in the \"End Date\" field.");
theForm.End Date.focus();
return (false);
}
if (theForm.Total Hours.value == "")
{
alert("Please enter a value for the \"Total Hours\" field.");
theForm.Total Hours.focus();
return (false);
}
var checkOK = "0123456789-.,";
var checkStr = theForm.Total Hours.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 += ".";
decPoints++;
}
else if (ch == "," && decPoints != 0)
{
validGroups = false;
break;
}
else if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only digit characters in the \"Total Hours\" field.");
theForm.Total Hours.focus();
return (false);
}
if (decPoints > 1 || !validGroups)
{
alert("Please enter a valid number in the \"Total Hours\" field.");
theForm.Total Hours.focus();
return (false);
}
if (theForm.Cost of Class.value == "")
{
alert("Please enter a value for the \"Cost of Class\" field.");
theForm.Cost of Class.focus();
return (false);
}
var checkOK = "0123456789-.,";
var checkStr = theForm.Cost of Class.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 += ".";
decPoints++;
}
else if (ch == "," && decPoints != 0)
{
validGroups = false;
break;
}
else if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only digit characters in the \"Cost of Class\" field.");
theForm.Cost of Class.focus();
return (false);
}
if (decPoints > 1 || !validGroups)
{
alert("Please enter a valid number in the \"Cost of Class\" field.");
theForm.Cost of Class.focus();
return (false);
}
return (true);
}
//--></script>