Validation rules are run when data is provided to the system to check that it conforms. This guide focuses on validating data which is inputted manually by users via fields.
...
When a field contains invalid data it is in an “error state”. When in this state:
The data should not be saved
An error message should be displayed beneath the field
The user should be able to move freely around the form or page and not be locked to the field
Any save options should be inactive, unless validation for the field can only be run on “save”
If the user leaves the form or page they should see the standard “Unsaved changes” warning [link to be added]
Note that a field can instead be in a warning state. Fields in this state can still be saved and are not considered to be invalid.
...
Messages should be informative yet short. We should avoid using words such as “please”. [add more stop words?]
Empty mandatory field
When a mandatory field is empty the error message should state: “Enter a/an/the {field label}”.
...
The field background color should change to the standard error background color
Field label text and feedback text be displayed in the standard error foreground color [to be reviewed]
A field may instead be in a warning state. In this case the warning styles would be applied.
...