How does one show multiple validation errors near matching multiple field locations instead of the default one at a time?
Let's say you have an apex:form with ten apex:inputFields. All these fields are required and there are validation rules for all these fields that don't permit empty fields.
Given the error condition state of 10 empty fields, the default behavior of visualforce is that after you click on the submit button, it shows only one of the 10 errors at a time near the field location. This is done via the standard controller as it seems to throw an exception for the last error (as opposed to aggregating all the errors and then throwing the exception)
My question is then, how do you show multiple visualforce validation inputfield errors near their re开发者_StackOverflowspective field locations instead of the standard one at a time? (which is annoying because you have to both fix the error and then click the submit button ten separate times!)
Yeah it's irritating, you'll need to use jQuery to get a neat solution. There's an article detailing the process here: http://developinthecloud.wordpress.com/2010/03/02/visualforce-form-validation-enhanced/.
精彩评论