i have a textbox and a button
if the textbox !="" & lost focus
i want button1 .enabled = true
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script type="text/javascript"> function OnLostFocus(t) { if (t.value != "") { document.getElementById("<%=Button1.ClientID %>").disabled = false; } else { document.getElementById("<%=Button1.ClientID %>").disabled = true; } } </script> </head> <body> <form id="form1" runat = "server"> <asp:TextBox ID="TextBox1" runat="server" onblur = "OnLostFocus(this)"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="Button" Enabled = "false" /> </form> </body> </html>
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.