Client side validation for various management events
I have a custom validator attached to a textbox control like this
<td align="center" width="10px">
<asp:CustomValidator ID="validateDateText" ControlToValidate="dateTextBox"
runat="server" OnServerValidate="ValidateDate"
ClientValidationFunction="Validate_Date" EnableClientScript="true"
Width="10px" CssClass="errortext" Text="*" Font-Size="Medium" Font-Bold="true" />
</td>
<td align="center" width="80px">
<asp:Textbox ID="dateTextBox" MaxLength="100" runat="server"
CssClass="dateselectortextbox" style="margin-right: 3px;" />
</td>
When I click a button on the page with valididation = "true" reasons, the client script is run, and the validation summary reflects the error message, and the validator shows *
However, when I exit the textbox, only the validator displays *, the validation is not updated
Client side validation works as the server code is not called im, but just trying to figure out why validationsummary is not being updated in the onblur event.
Any ideas?
EDIT:
ErrorMessage is set in the code to check the validator
I added EnableClientScript to my validationsummary file
I added ValidationGroup to my validationsummary, customvalidator, textbox and button, but still validation summary updates for button click, but not onblur event on textbox
source to share
You should definitely use errormessage = "xyz" for the message to be displayed in the verification summary. The review group shouldn't matter if you have multiple control items that you are reviewing.
There is a link to another post here that might help you get a summary of the validation to update after onblur.
source to share