The best location for error messages

For error messages, the same applies as for descriptions: the best location is above the form field. In addition, the error message must be linked to the form field via aria-describedby.

How to do this is described in the guideline Place descriptions between label and form field.

Note: Placing the message above the form field is best practice and not a WCAG requirement.

Resources