Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

gorm element id

Status
Not open for further replies.

lonelydragon

Programmer
Aug 5, 2004
75
US
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.
 
If that doesn't work, show the area where the Javascript is called.

Lee
 
meny.



*cLFlaVA
----------------------------
spinning-dollar-sign.gif
headbang.gif
spinning-dollar-sign.gif

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top