943,712 Members | Top Members by Rank

Ad:
Apr 9th, 2008
0

javascript for enabling and disabling

Expand Post »
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
santoo is offline Offline
17 posts
since Nov 2006
Apr 9th, 2008
0

Re: javascript for enabling and disabling

You can use if statement using ur radio button groups which are, in ur case set1 and set2, and inside them have statements like
Quote ...
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.
Reputation Points: 26
Solved Threads: 19
Posting Whiz in Training
Traicey is offline Offline
283 posts
since Mar 2008
Apr 10th, 2008
0

Re: javascript for enabling and disabling

SET1
<asp:RadioButton ID="rdintrvl" runat="server" Text="Interval" GroupName="set1" /> SET2
ASP Syntax (Toggle Plain Text)
  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

JavaScript Syntax (Toggle Plain Text)
  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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
santoo is offline Offline
17 posts
since Nov 2006
Apr 10th, 2008
0

Re: javascript for enabling and disabling

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
Reputation Points: 26
Solved Threads: 19
Posting Whiz in Training
Traicey is offline Offline
283 posts
since Mar 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: IIS Setup for AJAX
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Dynamically add rows to a form





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC