Adding a client event handler to tags other than the tagkey

Discussion in 'ASP .Net Web Controls' started by Nathan Sokalski, Nov 1, 2007.

  1. I want to add a client-side onchange event to the input tag generated by a
    CheckBox Control. However, because the CheckBox generates the following set
    of tags:

    <span><input/><label></label></span>

    If I try to add the onchange attribute to the CheckBox Control it is added
    to the span tag instead of the input tag (I understand why, so there is no
    need to explain that). The only way I can think of to add a client-side
    event handler to the input tag would be to use the RegisterStartupScript
    method to create JavaScript that adds an event handler. I know the ID of the
    input tag, but I am having trouble getting the JavaScript correct to add the
    eventhandler. Can someone help me? Thanks.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/
    Nathan Sokalski, Nov 1, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    618
  2. Replies:
    0
    Views:
    496
  3. Replies:
    1
    Views:
    682
    Damien
    Feb 22, 2007
  4. Nathan Sokalski
    Replies:
    1
    Views:
    330
    Mark Rae [MVP]
    Nov 1, 2007
  5. Zoe Hart
    Replies:
    1
    Views:
    344
    Scott Wisniewski
    Jan 8, 2004
Loading...

Share This Page