In this short sample is presented a method how to display a single error message for all validation fields besides the errors that are displayed near each field.
Having this behavior, if you have a long form with a lot of fields and you press the submit button, you'll see a generic error message at the bottom of the page alerting you that some fields didn't pass the validation.
This behavior works only if the validation is trigerred on submit.