Access isvalid property of ASP.NET validators in Javascript?

I found same! Try this document. GetElementById('XXX').

Validators0. Isvalid It's work for me.

Up vote 2 down vote favorite share g+ share fb share tw.

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?

Asp.net validation forms form-validation link|improve this question edited Sep 17 '11 at 11:02 asked Sep 26 '09 at 13:52mohammedn1,221417 90% accept rate.

Please post the validator declaration, along with your full JavaScript. Also, clarify what you mean by 'with no luck'. What error do you receive?

Displaying the current status of the isvalid attribute using the method you supplied worked for me. I suspect the id you are using (validator_clientID) is incorrect. – Phaedrus Sep 26 '09 at 14:36 I have tried accessing it like that and it works: bool flag = validatorname.

Isvalid; For some reason, accessing isvalid through the object direct was accessible. But I don't know why getting the element using getElementById didn't retrieve the object. I have tried it event using the validator ID - not the ClientID - and it's still unaccessible.

I got undefined value. – mohammedn Oct 6 '09 at 0:09.

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: msdn.microsoft.com/en-us/library/yb52a4x....

– Kelsey Aug 18 '10 at 16:14 This worked for me. Looks like... var isValid = Page_ClientValidate(); – Homer Mar 17 '11 at 18:24.

Remember to call IsValid instead isvalid (may vary).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions