Can anyone explain why this code fails when the set of checkboxes
consists of only one.
myForm.update.l ength returns 0 instead of 1 with the result that
I get an alert box even tho' the one checkbox is checked.
Thanks,
P
function checkForm(myFor m) {
var numBoxes = 1*myForm.update .length || 0;
for(i=0;i<numBo xes;i++) {
if(myForm.updat e[i].checked == true)
return true;
}
alert("Select one or more part components to update");
return false;
}
}
consists of only one.
myForm.update.l ength returns 0 instead of 1 with the result that
I get an alert box even tho' the one checkbox is checked.
Thanks,
P
function checkForm(myFor m) {
var numBoxes = 1*myForm.update .length || 0;
for(i=0;i<numBo xes;i++) {
if(myForm.updat e[i].checked == true)
return true;
}
alert("Select one or more part components to update");
return false;
}
}
Comment