silverstripe/silverstripe-userforms — pull request #190 by kmayo-ss (2014-02-11 23:54:28+00:00)
Title: BUG: Fixes #189 default error message being shown

This fixes the validation on Email and Numeric fields there may be other fields that also need to be fixed, but I would like this to be reviewed before proceeding.
It works by not allowing the default error message to be added to the custom script but adds it via attributes on the form field itself when the field type is numeric or email.

The reason for this is that if a form field has 2 types of validation like email and required the required error message will always be used.

EditableFormField has also been changed to fix a bug where a empty error messages was being displayed when the value for a Custom Error message under Required was removed, but the php code was still seeing the custom error message as being set.

This has been tested on Chrome, Safari, Firefox and IE9