Running javascript when a Radiobutton is changed

  • Thread starter Thread starter Robert Wagner
  • Start date Start date
R

Robert Wagner

I have several server side RadioButtons on my page that are all in a group.
What I want is that when the state of the radiobutton group changes (or of
an individual one) that a javascript is run. (It doesn't matter, but the
javascript will disable a textbox).

How can I do this on the client side only, no postback. With standard HTML,
you would add an onClick attribute to the radio tag, however I cannot figure
out how to add it to the RadioButton WebControl.
 
Hi
I have several server side RadioButtons on my page that are all in a group.
What I want is that when the state of the radiobutton group changes (or of
an individual one) that a javascript is run. (It doesn't matter, but the
javascript will disable a textbox).

this.RadioButton1.Attributes.Add("OnClick", "javascript:myFunction()");

Ciao
Giorgio
 
Thank you for that. Would have though you can do it on the "asp" side of
things, or through the visual IDE, but oh well.
 
Back
Top