views:

684

answers:

2

I have read here that all ASP.NET validators have a property called: isvalid which can be used in the client side. However, I hav tried to access this property in the client side as following but with no luck: alert(document.getElementById("validator_clientID").isvalid);

Do you have any idea why this is not accessible?

Your help is appreciated. Thanks!

A: 

I don't think the isvalid works on a validator control directly as this is a server side validation function. You can fire a validator check for the current page or validation group using the client side javascript function Page_ClientValidate. You can optionally specify a validation group name a parameter. This will return true if all the validation passes.

You can also look at more available client-side functions and how they map to the server side functions on MSDN at:

http://msdn.microsoft.com/en-us/library/yb52a4x0.aspx

Kelsey
@mnour just following up, did you ever get this figured out?
Kelsey
A: 

I found same !
try this
document.getElementById('XXX').Validators[0].isvalid
It's work for me

Sylar_