I have a simple web form with a textbox and a RequiredFieldValidator wired up to it. When the RequiredFieldValidator error is triggered the user has to click the submit twice to post the form. The first click clears the error, the second actually fires off the button click event. Is this expected behavior?
<asp:RequiredFieldValidator ID="reqFieldCloseComment" ControlToValidate="tbCloseComment" ValidationGroup="ChangeStatus" ErrorMessage="Please enter a reason" Display="Dynamic" runat="server"></asp:RequiredFieldValidator>
<asp:TextBox ID="tbCloseComment" runat="server" CausesValidation="true" TextMode="MultiLine" Height="107px" Width="400px"></asp:TextBox>
<asp:Button ID="btnCloseRequestFinal" Text="Finish" CssClass="CloseReqButton" runat="server" ValidationGroup="ChangeStatus" />
I tried adding CausesValidation
to the textbox per a suggestion found from a Google search and it doesn't help.
EDIT It seems that it doesn't always have to be a double click to fire off the event. As long as text is entered into the textbox and then the focus is taken away from the textbox, the RequiredFieldValidator error message goes away and the form requires only a single click.