WordPress.org

Make WordPress Core

Opened 8 months ago

Last modified 2 weeks ago

#38606 new defect (bug)

Accessibility: required fields in login/register/password-reset forms

Reported by: ramiy Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Login and Registration Keywords: required-fields has-patch
Focuses: accessibility Cc:

Description

In wp-login.php we have a login form, registration form and password reset form. All those forms have required fields. Let's make those fields more accessible with aria-required="true" attribute.

Related: [8853] and [36879]

Attachments (1)

38606.patch (3.8 KB) - added by ramiy 8 months ago.

Download all attachments as: .zip

Change History (5)

@ramiy
8 months ago

#1 @afercia
8 months ago

  • Keywords required-fields added
  • Milestone changed from Awaiting Review to Future Release

#2 @ramiy
8 months ago

  • Keywords has-patch added

#3 @Cheffheid
2 weeks ago

Out of curiosity, why aria-required and not the HTML5 required attribute? (Or both, if support is a concern, though with 4.8 dropping IE10 and older I think we should be safe).

I think I'd personally prefer using the required attribute because it comes with the benefits of aria-required and also has a client-side validation component. That is to say, a browser won't even submit the form if required fields are left empty.

And finally, I think the aim for this ticket is at least partially the same as #32510 - it may be worth consolidating the two (cc @afercia)?

#4 @afercia
2 weeks ago

Theoretically, required should be preferred over aria-required, because ARIA shouldn't be used when there's some native, equivalent, HTML feature. However the client-side validation triggered by required is largely inconsistent across browsers. This should be carefully evaluated.

Note: See TracTickets for help on using tickets.