0

Is it possible to have two ValidationSummary controls. One to display popup errors for some fields and one to display the standard summary for other fields?

Thanks

1 Answer 1

2

Yes, you can group validation using the ValidationGroup property on the form controls and the Summary control.

EDIT:

Using jQuery you could do something like this:

var validators = jQuery('.dataEntryFormTable').find("span[controltovalidate]");

validators.each(function()
{

var validatorEnabled = true;
        if (jQuery('#' + this.id).attr('enabled') == false) {
            validatorEnabled = false;
        }

if (validatorEnabled)
{
// Check if Valid
// then Get Mesage Text, assign to list of messages to display
}

}
Sign up to request clarification or add additional context in comments.

4 Comments

Hi, Yeah I have that but when I click one button I would like the summary to display for one field and a popup to display for the other field. I have two required field validators each with a different ValidationGroup. I am not sure its possible to do both at the same time with one button.
Using jQuery, you could iterate through each validator construct your own message or messages for each group.
Thanks. Just so I am clear, there is no way that the built in validation controls can do this without an external script?
I dont think so, we resorted to using something like this to style up the control using the ControlToValidate Property. You could use this to completely replace the ASP.NET Summary control. We found this a good extension to the standard ASP.NET validation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.