• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamic names for checkbox  RSS feed

 
Saket Barve
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am setting the checkbox names dynamically. Now, I need to write a JavaScript function to play around with the checkbox value - except that the checkbox name comes dynamically. How to access it in JavaScript?

The following code sample fails, because I am not able to fetch the name variable's value inside the script:




Regards,
Saket

PS: onclick() wouldn't let me post this so hence the "ABC" concept. I am calling the onClick() method appropriately.
[ September 05, 2005: Message edited by: Saket Barve ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
document.forms[0].elements[name].checked
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!