I have a textbox in an updatepanel, set to autopostback. It's working fine when I change the text.
The problem is, that I'd like to allow users to clear the box content as well. So it should also post back on a blank box. But after deleting the text, it's not posting.
I have a validation control, but it's only for the max character count, and allows zero. I've tried it without that validation and it's still not posting back on an empty textbox.
What do I need to change?
<asp:UpdatePanel ID="UpdatePanelPhone" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<label class="col-md-4 col-xs-5 control-label">Phone Number</label>
<div class="col-md-8 col-xs-7">
<asp:RegularExpressionValidator ID="txtPhoneRegularExpressionValidator" runat="server"
ControlToValidate="txtPhone"
Text="Maximum 50 characters"
ValidationExpression="^.{0,50}$"
Display="None"
CssClass="label label-danger label-form" />
<div class="input-group">
<span class="input-group-addon"><span class="fa fa-phone"></span></span>
<asp:TextBox ID="txtPhone" runat="server" CssClass="form-control validate[maxSize[50]]" AutoPostBack="True" OnTextChanged="txtPhone_TextChanged" CausesValidation="True"/>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID ="txtPhone" EventName ="TextChanged" />
</Triggers>
</asp:UpdatePanel>