Skip to content

Commit

Permalink
Update guidance to emphasise importance of error messages on grouped …
Browse files Browse the repository at this point in the history
…inputs
  • Loading branch information
Chris Thomas authored and 36degrees committed Jul 28, 2020
1 parent 26f59d8 commit e8489d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/date-input/index.md.njk
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ You will not normally need to use the `autocomplete` attribute in prototypes, as

### Error messages

Error messages should be styled like this if you’re highlighting the date as a whole:
If you’re highlighting the date as a whole, style all of the fields like this:

{{ example({group: "components", item: "date-input", example: "error", html: true, nunjucks: true, open: false, size: "m"}) }}

Or like this is you’re highlighting just one of the day, month or year:
If you’re highlighting just one of the day, month or year, only style the field with an error. The error message must clearly state which field has an error.

{{ example({group: "components", item: "date-input", example: "error-single", html: true, nunjucks: true, open: false, size: "m"}) }}

Expand Down
2 changes: 1 addition & 1 deletion src/components/error-message/index.md.njk
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ For each error:

- put the message in red after the question text and hint text
- use a red border to visually connect the message and the question it belongs to
- if the error relates to specific text fields within the question, give these a red border as well
- if the error relates to a specific field within the question, give the field a red border and refer to it clearly in the error message

To help screen reader users, the error message component includes a hidden 'Error:' before the error message. These users will hear, for example, "Error: The date your passport was issued must be in the past".

Expand Down

0 comments on commit e8489d0

Please sign in to comment.