If we click no in the radiobutton the textbox text is not erassed how can this problem is solve ???/
http://www.aspforums.net/Threads/187532/Enable-Disable-TextBox-on-ASPNet-RadioButton-click-using-Javascript/Replies/1
Here I have created sample that full-fill your requirement.
HTML
<div> <asp:RadioButton ID="RadioButton1" runat="server" Text="Yes" GroupName="Radio" onclick="Radio_Click()" /> <asp:RadioButton ID="RadioButton2" runat="server" Text="No" GroupName="Radio" onclick="Radio_Click()" /> <br /> <asp:TextBox ID="TextBox1" runat="server" Enabled="false"></asp:TextBox> <script type="text/javascript"> function Radio_Click() { var radio1 = document.getElementById("<%=RadioButton1.ClientID %>"); var textBox = document.getElementById("<%=TextBox1.ClientID %>"); if (!radio1.checked) { textBox.value = ''; textBox.disabled = true; } else { textBox.disabled = false; textBox.focus(); } } </script> </div>
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.