Adding a client event handler to tags other than the tagkey

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

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.
 
[cross-posting removed]
I want to add a client-side onchange event to the input tag generated by a
CheckBox Control.

A CheckBox webcontrol renders as an <input type="checkbox" /> control, which
doesn't have an onchange event so you're wasting your time trying to wire
one up...

<input type="checkbox" /> controls have the following object-specific event
handler properties:

onblur
onclick
onfocus
onmousedown
onmousemove
onmouseout
onmouseover
onmouseup
 
Back
Top