Hello all,
cam omeone help me out with this code:
Im looking to hide/show a textbox. When one checkbox is checked the textbox will be displayed, when the other checkbox is checked the textbox will be hidden. The name of the textbox is Other
Code:<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { DiscretionaryCheckbox.Attributes.Add("onclick", "Hide()"); OtherCheckbox.Attributes.Add("onclick", "Show()"); } </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <script> function Hide() { } function Show() { } </script> <body> <form id="form1" runat="server"> <div> <table style="width: 616px; height: 106px"> <tr> <td style="font-size: 9pt; width: 269px; font-family: Arial"> <asp:RadioButton ID="DiscretionaryCheckbox" runat="server" AutoPostBack="True" CssClass="Checkbox" GroupName="1" OnCheckedChanged="DiscretionaryCheckbox_CheckedChanged" TabIndex="9" Text="Discretionary" /> <asp:RadioButton ID="OtherCheckbox" runat="server" AutoPostBack="True" CssClass="Checkbox" GroupName="1" OnCheckedChanged="OtherCheckbox_CheckedChanged" TabIndex="10" Text="Other" /></td> </tr> <tr> <td style="font-size: 9pt; width: 269px; font-family: Arial"> <asp:TextBox ID="Other" runat="server" CssClass="Textbox" TabIndex="11"></asp:TextBox></td> </tr> </table> </div> </form> </body> </html>





Bookmarks