&的ValidationGroup QUOT;在一个特定的&QUOT启用/禁用asp.net验证控件;使用jQuery?
问题描述:
我知道如何启用/使用在客户端禁用各个验证程序控件
I know how to enable/disable individual validator controls on the client side using
ValidatorEnable(validator, false);
但你如何启用/禁用的ValidationGroup ?
答
验证器属性不会呈现为属性遗憾的是,我不知道一个好办法,直接选择他们。您可以尝试迭代Page_Validators阵列并筛选出你想一起工作的人。
The validator properties aren't rendered as attributes unfortunately, so I don't know a good way to select them directly. You can try to iterate the Page_Validators array and filter out the ones you want to work with.
尝试:
$.each(Page_Validators, function (index, validator){
if (validator.validationGroup == "your group here"){
ValidatorEnable(validator, false);
}
});