uswds-site
uswds-site copied to clipboard
Create markdown file for forms guidance
In order for @jaclinec to make the updates to her forms guidance, she needed help converting the guidance into markdown.
Usability Guidance for Required Fields
Do:
- Show whether a field is required or optional. Mark required fields as required by using a red asterisk *
- Combine the red asterisk * with a text description at the top of the form instructing the user of its meaning.
Example: “A red asterisk * indicates a required field.”
- Add the
required
attribute to any specific form elements that are required to let users of assistive technologies know this is a required field. - Label optional fields with the word “optional” placed in parentheses.
Example: (optional)
- Error handling: Use a message or alert to notify the user if a field that is required was not completed, and indicate which field was not completed. Additionally, include an error notification in the page title (
title
element) for screen readers.
Note: One-field forms are the exception and do not need to be marked with a required label or symbol.
This is done @brunerae and @thisisdano and the work is continued in #1834