Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Running javascript when a Radiobutton is changed

Reply
Thread Tools

Running javascript when a Radiobutton is changed

 
 
Robert Wagner
Guest
Posts: n/a
 
      11-05-2003
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.


 
Reply With Quote
 
 
 
 
Giorgio Parmeggiani
Guest
Posts: n/a
 
      11-05-2003
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



 
Reply With Quote
 
 
 
 
Robert Wagner
Guest
Posts: n/a
 
      11-06-2003
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.

"Giorgio Parmeggiani" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
running javascript when textbox value has changed Dmitry Duginov ASP .Net 8 12-13-2007 03:28 AM
changed state to up changed state to down FastEthernet LINEPROTO-5-UPDOWN surrealarmada@gmail.com Cisco 3 03-07-2007 06:06 PM
scroll position is changed when style is changed? mxbrunet Javascript 1 11-03-2006 03:40 AM
xmlDocument.Save "&#10;" getting changed changed to "&amp;#10" st@jpa.co.jp ASP .Net 1 10-11-2005 01:30 PM
RadioButton (or Checkbox) event firing if selected (not changed) tshad ASP .Net 5 03-15-2005 09:36 AM



Advertisments