function Subscribe() {
if (typeof (Page_ClientValidate) == 'function') {
Page_ClientValidate();
}
if (Page_IsValid) {
// do something
CheckUser();
}
}
The script is tied to an asp.net button with regular express开发者_高级运维ion validators. I have another form on my page with a different validation group specified.
When I click on this button (with all conditions met). It fires an error on the other validationgroup. How and why is this happening? Is there a way to counter this?
Its as if Javascript is validating all fields irrespective of which group they are from/in
You can pass the validation group as an argument like
Page_ClientValidate("valMyValGroup");
i think you have to specify an empty group name if you don't want to validate everything.
Page_ClientValidate('');
I managed to get it working by passing the validation group name to Page_ClientValidate.
function Subscribe() {
if (typeof (Page_ClientValidate) == 'function') {
Page_ClientValidate('groupname');
}
if (Page_IsValid) {
// do something
CheckUser();
}
}
精彩评论