View Full Version : validating .net validation controls using javascript

03-30-2009, 05:12 PM
I need to validate multiple .net validation groups(a normal group would consist of RequiredFieldValidators, RegularExpressionValidators, ValidationSummary, etc) using javascript. I am using Page_ClientValidate("GroupName") to validate the groups. The problem arises when i validate multiple groups. The validation summary and errors only appear for the last group validated or nothing appears if the last group validated returns true. I want all validation summaries and errors to appear for all groups that return a false validation. I'll never validate all groups, so I can't use Page_ClientValidate(). I have multiple tabs on a page and each tab has 1 or more validation groups assigned to it. Any ideas/solutions would be most appreciated. I've hit a wall for now.

Example of what i am doing:

var Tab1 = false;var Tab2 = false;var Tab3 = false;

Tab1 = Page_ClientValidate("Tab1");
Tab2 = Page_ClientValidate("Tab2");
Tab3 = Page_ClientValidate("Tab3");

if(Tab1 && Tab2 && Tab3)

04-20-2009, 02:58 PM
This really has nothing to do with Ajax and design and should have been posted in the .NET section of the forum.

Sounds like the validation control overrides whatever is in the output summary section. It might be easier to code your own with a custom validator if the documentation does not tell you anything else.