change parameters from name to ID for check-all script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • urgido
    New Member
    • Oct 2006
    • 3

    #1

    change parameters from name to ID for check-all script

    Hi, this is my first post here and i need very much your help.

    Yesterday, I download the follow script: http://javascriptkit.com/script/script2/checkall.shtml this script can checkall/uncheckall checkbox or radiobuttons based on the name attribute but I want to force to this script to works with the ID attribute. Can somebody givme a hand?

    Best Regards
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    The problem is that IDs must be unique, so you can only check one at a time unless the IDs are something like "check0", "check1", etc. in which case you can pass "check" as the parameter and then use document.getEle mentById(parame ter+i).checked = thestate where i is the loop index.

    Comment

    Working...