admin管理员组

文章数量:1397093

I am validating some validators in javascript on the button client click event.

if (typeof (Page_Validators) != "undefined") {

            for (var i = 0; i < Page_Validators.length; i++) {

                    ValidatorValidate(Page_Validators[i])
                    if (!Page_Validators[i].isvalid) {

                        alert("not valid");
                    }
                    else {
                        alert("valid");
                    }                    
            }
        }

But if i have more than one validation groups in the same page, then on the button click of one button will validate all the validators in the page, not the validators associated with that button's validation group.

So is there any way to only validate validators of a particular validation group from javascript?

I am validating some validators in javascript on the button client click event.

if (typeof (Page_Validators) != "undefined") {

            for (var i = 0; i < Page_Validators.length; i++) {

                    ValidatorValidate(Page_Validators[i])
                    if (!Page_Validators[i].isvalid) {

                        alert("not valid");
                    }
                    else {
                        alert("valid");
                    }                    
            }
        }

But if i have more than one validation groups in the same page, then on the button click of one button will validate all the validators in the page, not the validators associated with that button's validation group.

So is there any way to only validate validators of a particular validation group from javascript?

Share Improve this question asked May 8, 2012 at 15:04 Mahesh KPMahesh KP 6,45613 gold badges53 silver badges71 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

Try

Page_ClientValidate('ValidationGroup');

本文标签: aspnetValidate particular validation group from javascriptStack Overflow