I have a simple web form with a text box and the RequiredFieldValidator associated with it. When the RequiredFieldValidator error is triggered, the user needs to double-click the link to submit the form. The first click clears the error, the second actually fires when the button is pressed. 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 text box according to the sentence found in a Google search, and this does not help.
EDIT It seems that there should not always be a double click to disable the event. As the text is entered into the text field and then the focus is removed from the text field, the RequiredFieldValidator error message disappears, and the form requires only one click.
zeroef
source share