Wednesday, September 28, 2011

To Hide all asp.net Validations in a page on reset button click


function HideValidators() {
            //Hide all validation errors 
            if (window.Page_Validators)
                for (var vI = 0; vI < Page_Validators.length; vI++) {
                    var vValidator = Page_Validators[vI];
                    vValidator.isvalid = true;
                    ValidatorUpdateDisplay(vValidator);
                }
            //Hide all validaiton summaries 
            if (typeof (Page_ValidationSummaries) != "undefined") { //hide the validation summaries 
                for (sums = 0; sums < Page_ValidationSummaries.length; sums++) {
                    summary = Page_ValidationSummaries[sums];
                    summary.style.display = "none";
                }
            }
        }

No comments:

Post a Comment