lonelydragon
Programmer
i have the following code,
function selectOne(check,n,total,myVal) {
n = n+1;
for (i=0;i<total;i++) {
if (check) document.reportForm.myVal.checked=false;
}
}
in the above code, "myVal" is the id of a form element array, e.g, userList. if i change the 'myVal' to the actual name "userList", then it works fine, but if i change to a variable, then it no longer work. can anyone help?
the reason i put a variable is i use the function in several place, and the variable name are different.
thank you for your help.
function selectOne(check,n,total,myVal) {
n = n+1;
for (i=0;i<total;i++) {
if (check) document.reportForm.myVal.checked=false;
}
}
in the above code, "myVal" is the id of a form element array, e.g, userList. if i change the 'myVal' to the actual name "userList", then it works fine, but if i change to a variable, then it no longer work. can anyone help?
the reason i put a variable is i use the function in several place, and the variable name are different.
thank you for your help.