469,271 Members | 1,320 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

Disable radio button on clicking a checkbox

17
Hi all,(Its urgent)


I have a asp:radiobutto and asp:checkbox in my page..
Once the checkbox is clicked the radiobutton should be disabled ..how can i do it with javascript or AJAX..



Thanks in advance..
Mar 21 '08 #1
2 3046
gits
5,390 Expert Mod 4TB
that has nothing to do with ajax ... it is simple javascript ... have a look at the following example:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2.     <head>
  3.         <script type="text/javascript">
  4.         function toggle_node(id, cbn) {
  5.             var n = document.getElementById(id);
  6.             n.disabled = cbn.checked;
  7.         }
  8.         </script>
  9.     </head>
  10.     <body>
  11.     <input type="button" id="mb" value="my_button"/>
  12.     <input type="checkbox" onclick="toggle_node('mb', this);"/>
  13.     </body>
  14. </html>
  15.  
for a radiobutton just change the type of the button to radio and see how it works :)

kind regards
Mar 21 '08 #2
acoder
16,027 Expert Mod 8TB
Changed the thread title. Please use meaningful titles for any threads started (see the FAQ entry Use a Good Thread Title). In particular, avoid words such as "urgent". It doesn't make the question any more urgent for someone answering your question.
Mar 22 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Bob Bedford | last post: by
10 posts views Thread by DettCom | last post: by
1 post views Thread by J Belly | last post: by
1 post views Thread by hortoristic | last post: by
3 posts views Thread by Harry Haller | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.