I’ve a web page with a textbox as below –
<asp:TextBox ID="txtNumber" runat="server" size="5" MaxLength="9"
AutoPostBack="True" OnTextChanged="txtNumber_TextChanged"
CssClass="txtBoxPage" Style="margin-left: 3px;"
Visible="false" onblur="return [some JS function] false;">
</asp:TextBox>
I want a functionality such that if User enters Nothing i.e. (”) in textbox and move the cursor outside the textbox then Postback should not trigger. Currently it’s getting triggered even after onblur event returns false.
If textbox value is empty, you can supress
TextChangedevent as below –Add following line in Page_Load –
Include following JavaScript in markup –
Try above code and let me know if it works.