jimmythegeek
Programmer
I am sure this is an easy syntax thing, but I can't seem to get it. This works fine:
function checkAll() {
for(var i=0; i<document.frm.chk1.length; i++) {
document.frm.chk1.checked=true;
}
}
However, I have sevaral check box control arrays (chk1, chk2, chk3, etc.), and want to be able to dynamically check them all, but the following bombs when I try to concatenate "x" onto the chk control (line 5), it says document.frm.chk is null or not an object.
function checkAll() {
var modes = 6
for(var x=1; x < modes; x++) {
for(var i=0; i<document.frm.chk1.length; i++) {
document.frm.chk[x].checked=true;
}
}
}
Thanks in advance.
Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
function checkAll() {
for(var i=0; i<document.frm.chk1.length; i++) {
document.frm.chk1.checked=true;
}
}
However, I have sevaral check box control arrays (chk1, chk2, chk3, etc.), and want to be able to dynamically check them all, but the following bombs when I try to concatenate "x" onto the chk control (line 5), it says document.frm.chk is null or not an object.
function checkAll() {
var modes = 6
for(var x=1; x < modes; x++) {
for(var i=0; i<document.frm.chk1.length; i++) {
document.frm.chk[x].checked=true;
}
}
}
Thanks in advance.
Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?