I have a WebForm (VB.NET) containing two Textboxes.
TextBox2 is Enable=False when Form is loading.
How do I enable TextBox2 when clicking on TextBox1 ?
note : in VB.Forms this would be :
TextBox2.Enabled = True in the TextBox1_click event !
Using jQuery:
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $("[id*=TextBox1]").click(function () { $("[id*=TextBox2]").removeAttr('disabled'); }); }); </script> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server" /> <asp:TextBox ID="TextBox2" Enabled="false" runat="server" /> </div> </form> </body> </html>
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.