Page validation not working in javascript
- by crisgomez
Hi,
I have a problem regarding checking the page validation in javascript.
I have a user controls in my aspx page,for example control1, control2, and control3.
For each control I created a validation group, then I tried to use the code below, the problem is, it will always return a false value eventhough the page validation has been satisfied.What went wong with the code below?By the way I used Ajax in my application.
if (typeof (Page_Validators) != "undefined") {
if (typeof (Page_ClientValidate) == 'function') {
Page_ClientValidate();
}
if (Page_IsValid) {
// do something
alert('Page is valid!');
}
else {
// it will always goes here eventhough it was validated successfully
alert('Page is not valid!');
}
}