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.

1 Answer 1

1

Try this:

oSrc.errormessage = "Your validation message here";

Edit

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.