diff --git a/packages/css/src/components/form-error-list/README.md b/packages/css/src/components/form-error-list/README.md new file mode 100644 index 0000000000..9ddd4542fd --- /dev/null +++ b/packages/css/src/components/form-error-list/README.md @@ -0,0 +1,35 @@ + + +# Form Error List + +Use this component at the top of a page to summarise any errors a user has made. +When a user makes an error, you must show both a Form Error List and an Error Message above each answer that contains an error. + +## Guidelines + +- Always show a Form Error List when there is a validation error, even if there’s only one. +- You must link the errors in the Form Error List to the answer they relate to (see below). + +## Linking from the Form Error List to each answer + +For questions that require a user to answer using a single field, like a file upload, select, textarea, text input or character count, link to the `id` of that field. + +When a user has to enter their answer into multiple fields, such as day, month and year fields, link to the `id` of the first field that contains an error. +If you do not know which field contains an error, link to the `id` of the first field. + +For questions that require a user to select one or more options from a list using Radios or Checkboxes, link to the `id` of the first Radio or Checkbox. + +## Where to put the Form Error List + +Put the Form Error List at the top of the main container, outside of the `