I want to enable a textBox and make it Visible (default settings are false for both) on button click. I can postback but it's inefficient so I want my button to activate onClientClick just to activate and make it Visible.
I tried this:
JS:
function EnableTxt() {
document.getElementById( '<%=txtSearch.ClientID%>' ).disabled = 'false';
}
HTML:
<asp:ImageButton ID="btnSearch2" runat="server" ImageUrl="~/Images/search.png" Height="27px" Width="30px" ImageAlign="AbsBottom" OnClientClick="EnableTxt()"/>
<asp:TextBox ID="txtSearch" runat="server" CssClass="btnSearchStyle" Height="27px" Width="134px" onkeypress="return EnterEvent(event)" BackColor="#BDC3C7" BorderStyle="None" Visible="true" Enabled="false"></asp:TextBox>
The JS function that I found doesn't do anything...