javascript for enabling and disabling

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Nov 2006
Posts: 17
Reputation: santoo is an unknown quantity at this point 
Solved Threads: 0
santoo santoo is offline Offline
Newbie Poster

javascript for enabling and disabling

 
0
  #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.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 268
Reputation: Traicey is an unknown quantity at this point 
Solved Threads: 19
Traicey's Avatar
Traicey Traicey is offline Offline
Posting Whiz in Training

Re: javascript for enabling and disabling

 
0
  #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 3:55 pm.
Some people get so rich they lose all respect for humanity. That's how rich I want to be.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 17
Reputation: santoo is an unknown quantity at this point 
Solved Threads: 0
santoo santoo is offline Offline
Newbie Poster

Re: javascript for enabling and disabling

 
0
  #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 8:15 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 268
Reputation: Traicey is an unknown quantity at this point 
Solved Threads: 19
Traicey's Avatar
Traicey Traicey is offline Offline
Posting Whiz in Training

Re: javascript for enabling and disabling

 
0
  #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 Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC