| | |
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
![]() |
•
•
Join Date: Nov 2006
Posts: 17
Reputation:
Solved Threads: 0
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.
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.
You can use if statement using ur radio button groups which are, in ur case set1 and set2, and inside them have statements like And another thing you may post ur code so that we can be aware of what we are trying to achieve right??
•
•
•
•
document.Formname.NameOfTheRAD.selected="False" or "true"
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.
•
•
Join Date: Nov 2006
Posts: 17
Reputation:
Solved Threads: 0
SET1
in the page load
javascript function is
<asp:RadioButton ID="rdintrvl" runat="server" Text="Interval" GroupName="set1" /> SET2 ASP Syntax (Toggle Plain Text)
<asp:RadioButton ID="rddays" Text="Days" GroupName="set2" runat="server" Enabled="False"/> <asp:RadioButton GroupName="set2" ID="rdweeks" Text="Weeks" runat="server" Enabled="False"/> <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)
function enable() { document.getElementById('<%=rddays.ClientID%>').disabled = false; document.getElementById('<%=rdweeks.ClientID%>').disabled = false; document.getElementById('<%=rdmonths.ClientID%>').disabled = false; }
Last edited by peter_budo; Apr 11th, 2008 at 8:15 pm. Reason: Keep It Organized - please use [code] tags
![]() |
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: IIS Setup for AJAX
- Next Thread: javascript onclick is not working in IE7 & IE6
| Thread Tools | Search this Thread |
acid2 ajax ajaxexample ajaxjspservlets array browser captcha captchaformproblem cart child class close codes column css date debugger decimal dependent design disablefirebug dom download editor element embed engine enter error events explorer ext file firefox focus form forms frameworks getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe index java javascript javascripthelp2020 jquery jsf jsp jump libcurl listbox maps masterpage math media menu mp4 object onerror onmouseoutdivproblem onmouseover onreadystatechange parent paypal pdf php position post problem programming prototype rated rating redirect safari scale scriptlets scroll search security select software star starrating stars synchronous toggle unicode variables w3c web webservice \n





