uswds-site icon indicating copy to clipboard operation
uswds-site copied to clipboard

Update guidance to encourage labeling required fields

Open thisisdano opened this issue 3 years ago • 3 comments

In most forms we should encourage teams to label required fields. More context and backup here: https://github.com/uswds/uswds/issues/3295. For this Issue, conduct research and compile a findings report to support this change.

First Week of Sprint

  • [x] #1354

thisisdano avatar Feb 25 '21 21:02 thisisdano

After recent discussions about this issue, we decided to dig further into a couple of questions:

  1. Get to the bottom of WCAG guidance. What does it say? Does it give exceptions (What about simple forms with one or two fields such as login pages?)?
  2. What are the best practices from a usability standpoint on whether exceptions should be made for calling out required form fields?

Next steps:

  • [x] Document what we have now on the site/what’s recommended and where
  • [x] Review previous research done, revisit other design systems referenced to see what current guidance is
  • [x] Review WCAG guidance
  • [x] Review best practices from a UX standpoint on this issue
  • [x] Present prelim findings to team and Dan
  • [x] Write up findings and make a recommendation

jaclinec avatar Sep 08 '22 20:09 jaclinec

After sharing preliminary findings with Dan, the guidance on whether to label required fields on login pages was still unclear from the sources consulted during this research. So we decided to reach out to the Login.gov team to ask about their approach to labeling required fields on login pages (and if they had any major discussions or research to support it).

I found out they don't mark required fields on the login page, saying that most users expect those fields to be required, but they have not had any significant discussions or done any research around it.

jaclinec avatar Sep 08 '22 20:09 jaclinec

Based on the review of WCAG guidelines, consulting sources for UX best practices, and further discussions with the team, here is the recommendation for labeling required fields guidance.

USWDS RECOMMENDATION:

Be explicit about whether a field is required or optional. Always mark required fields as required by using a red asterisk () combined with a text description at the top of the form instructing the user of its meaning (e.g. “A red asterisk () indicates a required field”). One-field forms are the exception and do not need to be marked with a required label or symbol.

Add the required attribute to form controls programmatically (HTML5 and ARIA required attributes for labels).

Mark optional fields with the optional label within parentheses: (optional).

Link to research document for more details.

jaclinec avatar Sep 08 '22 22:09 jaclinec

The work for this issue is complete. Updates to guidance and templates on the website are detailed in issue #1832

jaclinec avatar Oct 31 '22 13:10 jaclinec