0
I need to validate a Textbox field, for when it is empty paint to embroider indicating that there is some error with the field, I am using the customValidador but it is not working.
The code of Function.
function ValidatxtECFNrSerie(src, args) {
if (args.Value.length > 1) {
args.IsValid = true;
}
else {
args.IsValid = false;
}
}
and field code to validate.
<asp:TextBox ID="txtECFNrSerie" runat="server" MaxLength="15" Width="150px"></asp:TextBox>
<asp:CustomValidator runat="server" ID="CustomValidator1" ClientValidationFunction="ValidatxtECFNrSerie" ErrorMessage=" * " ValidationGroup="vgValidarCampo" Display="Dynamic" ControlToValidate="txtECFNrSerie"></asp:CustomValidator>
How do I validate an empty field with Customvalidator ?