Basically I was wondering whether we could simply display a generic "there are errors - please correct" message instead of the full message which also lists every error.
Does anyone know of a way something like this can be easily achieved?
I don’t understand why would errorSummary work on ajax validation and the above snippet not… both are rendered in the view… and btw. check the errorSummary source, it uses $model->getErrors().
It should work as this way we are copying the errorSummary()… also I tested it before posting…
Try to put the errorSummary() in your view and check the DIV it generates, should be the same as the manually added code above just with a different message (default one)
Nice find! yes it worked for me because I had still the errorSummary call so the JS line was there but only the manual DIV was shown because of duplicate ID’s… so not a good solution
Found a simpler way to achieve your need. As all the error messages are shown in a UL, just use the errorSummary() with a custom header and hide the UL with CSS
Thanks. Yeah that’s a good solution. Still I prefer if we just had a simple option to enable/disable listing all errors. I think this would be a reasonable request?
If some functionality is not needed frequently and there is a way to achieve the desired result I think it’s better to not be in the core. So it all relates on how useful would that be but a[size=2]s you have seen nobody else commented on your github issue, so i would say this need is very rare.[/size]