Page validation not working in javascript

Posted by crisgomez on Stack Overflow See other posts from Stack Overflow or by crisgomez
Published on 2010-05-17T03:48:45Z Indexed on 2010/05/17 4:00 UTC
Read the original article Hit count: 280

Filed under:
|
|
|

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!');
        }
    }

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about page