User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 426,901 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,347 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 748 | Replies: 3
Reply
Join Date: Nov 2006
Posts: 17
Reputation: santoo is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
santoo santoo is offline Offline
Newbie Poster

javascript for enabling and disabling

  #1  
Apr 9th, 2008
Hi,
I have some radiobuttons which I grouped them as set1..and another set of radiobuttons which I grouped as set2 which are disabled by default.When I click a radiobutton in set1 all the radiobuttons in set2 should be enabled and when I uncheck, all the radiobuttons should again become disabled.
How can this be done..plzz reply.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2008
Posts: 185
Reputation: Traicey is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 16
Traicey's Avatar
Traicey Traicey is offline Offline
Junior Poster

Re: javascript for enabling and disabling

  #2  
Apr 9th, 2008
You can use if statement using ur radio button groups which are, in ur case set1 and set2, and inside them have statements like
document.Formname.NameOfTheRAD.selected="False" or "true"

And another thing you may post ur code so that we can be aware of what we are trying to achieve right??
Last edited by Traicey : Apr 9th, 2008 at 2:55 pm.
Some people get so rich they lose all respect for humanity. That's how rich I want to be.
Reply With Quote  
Join Date: Nov 2006
Posts: 17
Reputation: santoo is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
santoo santoo is offline Offline
Newbie Poster

Re: javascript for enabling and disabling

  #3  
Apr 10th, 2008
SET1
<asp:RadioButton ID="rdintrvl" runat="server" Text="Interval" GroupName="set1" />
SET2
  1. <asp:RadioButton ID="rddays" Text="Days" GroupName="set2" runat="server" Enabled="False"/>
  2. <asp:RadioButton GroupName="set2" ID="rdweeks" Text="Weeks" runat="server" Enabled="False"/>
  3. <asp:RadioButton GroupName="set2" ID="rdmonths" Text="Months" runat="server" Enabled="False"/>

in the page load
rdintrvl.Attributes.Add("onclick", "enable();");

javascript function is

  1. function enable()
  2. {
  3.  
  4. document.getElementById('<%=rddays.ClientID%>').disabled = false;
  5. document.getElementById('<%=rdweeks.ClientID%>').disabled = false;
  6. document.getElementById('<%=rdmonths.ClientID%>').disabled = false;
  7. }
Last edited by peter_budo : Apr 11th, 2008 at 7:15 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Join Date: Mar 2008
Posts: 185
Reputation: Traicey is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 16
Traicey's Avatar
Traicey Traicey is offline Offline
Junior Poster

Re: javascript for enabling and disabling

  #4  
Apr 10th, 2008
So its not really a Javascript but VBscript not that I know but according to my understanding I think you need to use VBScript or C# when dealing with ASP.net and Im not really equiped about VBscript
Some people get so rich they lose all respect for humanity. That's how rich I want to be.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 11:05 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC