Checkboxlist add onchange event

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jason Hartsoe

    Checkboxlist add onchange event

    i've tried to add an onchange event to my checkboxes(crea ted dynamically)

    chkboxlist.attr ibutes.add("onc hange", "dothat();" )

    but it renders the onchange to the table it creates and not to the list
    items. I need to add the onchange event to all the checkbox(s) that are
    created dynamically. I've even tried

    dim li as ListItem
    for each li in chkboxlist
    li.attributes.a dd("onchange", "dothat();" )
    next

    but it still renders to the table that the chkboxlist creates rather than
    the items.

    Can this be done? If so can someone give some good examples?


    thanks!

    jason


  • bruce barker

    #2
    Re: Checkboxlist add onchange event

    the checkboxes are rendered as html, not control, so this can not be
    done serverside. you need to attach the click handlers with client
    script, or override the render of the clicklist.

    -- bruce (slwork.com)

    Jason Hartsoe wrote:
    i've tried to add an onchange event to my checkboxes(crea ted dynamically)
    >
    chkboxlist.attr ibutes.add("onc hange", "dothat();" )
    >
    but it renders the onchange to the table it creates and not to the list
    items. I need to add the onchange event to all the checkbox(s) that are
    created dynamically. I've even tried
    >
    dim li as ListItem
    for each li in chkboxlist
    li.attributes.a dd("onchange", "dothat();" )
    next
    >
    but it still renders to the table that the chkboxlist creates rather than
    the items.
    >
    Can this be done? If so can someone give some good examples?
    >
    >
    thanks!
    >
    jason
    >
    >

    Comment

    Working...