silverstripe/sapphire — pull request #513 by halkyon (2012-06-08 04:57:12+00:00)
Title: ENHANCEMENT Adding $hasErrors property to Form for detecting validation errors

Using this, you can detect whether a form had *any* validation error, regardless of whether it was a general form validation error (calling `sessionMessage()` on a form) or per-field (calling `addErrorMessage()` for each field.)

Typical use case would be in the template above the form:

`<% if Form.hasErrors %>There were validation errors. Please check the fields below<% end_if %>`