Every form field needs to have a label of some kind.  The label must be programmatically associated with the field. The traditional method of doing this is by using the "for" attribute on a label element as follows:

<label for="name-field">Name</label>
<input id="name-field" type="text">

Another common method is the use of aria-labels. Other methods for adding labels can be found here.

Evaluating a form for labels


Form validation can be a useful feature, but it should be designed in a way that considers the needs of all users, including those who can't see the error message visually, and those who are unable to use a mouse.

The easiest way to provide accessible form field validation is to use the "required" attribute on a field. It will handle providing the basic information to both sighted and screen reader users.

<input type="text" id="name-field" required="true">

Form field validation