I am getting an expected identifier with my script and was wondering if someone could tell me what is wrong with it?
function checkit()
{
tf='15' //number of text fields (tf)
num='0' //set your counter value to zero
for (k=1;k<=tf;k++) { //start reading the text boxes
x=eval("document.form1.date"+k+".value"
//give x the value of a text box, based on the value of k
if (x!='') {num++;} //if it is not empty, add 1
}
for(var i=1;i<num;i++) {
var theDate = document.form1.["hour" + i].value;
var dateArr = theDate.split("/"
checkstr = document.form1.hidden1.value;
if (checkstr != dateArr[0])
{
alert ('your months do not match');
return false;
}
}
}
function checkit()
{
tf='15' //number of text fields (tf)
num='0' //set your counter value to zero
for (k=1;k<=tf;k++) { //start reading the text boxes
x=eval("document.form1.date"+k+".value"
if (x!='') {num++;} //if it is not empty, add 1
}
for(var i=1;i<num;i++) {
var theDate = document.form1.["hour" + i].value;
var dateArr = theDate.split("/"
checkstr = document.form1.hidden1.value;
if (checkstr != dateArr[0])
{
alert ('your months do not match');
return false;
}
}
}