0

environment: asp.net 3.5

<asp:CustomValidator ID="cvServerValidateDate" runat="server" 
    ControlToValidate="tbDate" onservervalidate="cvValidateServer" 
    ValidateEmptyText="True" ClientValidationFunction="validateDate"></asp:CustomValidator>



<script type="text/javascript">
    function validateDate(oSrc, args)
    {
        args.IsValid = (args.Value.length >= 8);        
    }
</script>  

if the client-side validation is args.IsValid = false is there a way to access the validator's error message value to indicate a specific error? i have several different error messages and i'd like to send of them based on type of error.

Rod
  • 14,529
  • 31
  • 118
  • 230

1 Answers1

1

Try this:

oSrc.errormessage = "Your validation message here";

Edit

After some further digging I found this question which has more detailed answer.

Community
  • 1
  • 1
Sir Crispalot
  • 4,792
  • 1
  • 39
  • 64