views:

265

answers:

1

Hi, I'm using jQuery validation in ASP.net MVC. I would like to show validation summary and also individual error messages besides the control. I can do either one at a time. So it would be really helpful to know how can I display both.

Thank you.

A: 

I assume you are looking for JQuery only solution. I have no idea about the ASP .net MVC part.

You could use these hooks to accomplish most of it you want.

invalidHandler: function(e, validator) {
var errors = validator.numberOfInvalids();
// show the summary info here
},
errorPlacement: function(error, element) {
// element level error display manipulation
},
showErrors: function(errorMap, errorList) {
// Callback when the errors are actually shown
}

Check some of the examples in the jQuery validation plugin documentation.

shazmo
That surely worked. Thanks a lot.
developer