Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Validate particular validation group from javascript

I am validating some .net 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?

like image 665
Mahesh KP Avatar asked Oct 25 '25 23:10

Mahesh KP


1 Answers

Try

Page_ClientValidate('ValidationGroup');
like image 64
Crab Bucket Avatar answered Oct 28 '25 11:10

Crab Bucket