http://forums.asp.net/t/1844055.aspxRecently, I replied to an answer.
most of times we try no to postback (using updatepanel is another thing, we dont want to respond to the server for better performance.)
We can disable 1 radio button or item easily but how would be disable all RadioButtons or Checkboxes? which are dynamic, by SQLDatasource ETC.
I made this Jquery.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js" type="text/javascript"></script> <script type="text/javascript" language="javascript"> function toggleStatus() { var Drp = document.getElementById('DropDownList1'); if (Drp.value == "Disable RadioList") { $('#some :input').attr('disabled', true); } else { $('#some :input').removeAttr('disabled'); } } </script>
<asp:DropDownList ID="DropDownList1" runat="server" onchange="toggleStatus()"> <asp:ListItem>Enable RadioList</asp:ListItem> <asp:ListItem>Disable RadioList</asp:ListItem> </asp:DropDownList> <br /><div id="some"> <asp:RadioButtonList ID="RadioButtonList1" runat="server"> <asp:ListItem>Good?</asp:ListItem> <asp:ListItem>Bad?</asp:ListItem> <asp:ListItem>No idea!</asp:ListItem> </asp:RadioButtonList></div>


Wednesday, September 19, 2012
Mahad Bin Mukhtar