Groups | Blog | Home
all groups > asp.net > november 2003 >

asp.net : Running javascript when a Radiobutton is changed



Giorgio Parmeggiani
11/5/2003 3:30:59 PM
Hi

[quoted text, click to view]

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

Ciao
Giorgio


Robert Wagner
11/5/2003 9:26:41 PM
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.

Robert Wagner
11/6/2003 1:48:29 PM
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.

[quoted text, click to view]

AddThis Social Bookmark Button