I have read here that any ASP.NET validator has a property called: isvalid
. This property can be used in client side to check if the validator successfully passed the validation or not.
I tried to access this property as following but for some reason the code fail:
alert(document.getElementById("validator_clientID").isvalid);
Do you have any idea why this is not working?
Page_ClientValidate() will work. It returns true if the page was valid and it works fine. If you are using ASP.NET 2.0, pass the validation group name as a parameter.
IsValid(Object)Determines whether the specified value of the object is valid.
ASP.NET validation controls validate the user input data to ensure that useless, unauthenticated, or contradictory data don't get stored. ASP.NET provides the following validation controls: RequiredFieldValidator. RangeValidator.
I found same !
try this document.getElementById('XXX').Validators[0].isvalid
It's working for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With