Make WordPress Core

Opened 15 months ago

Last modified 5 months 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:


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 (2)

38606.patch (3.8 KB) - added by ramiy 15 months ago.
38606.2.patch (3.7 KB) - added by ramiy 5 months ago.

Download all attachments as: .zip

Change History (7)

15 months ago

#1 @afercia
15 months ago

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

#2 @ramiy
15 months ago

  • Keywords has-patch added

#3 @Cheffheid
8 months 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
8 months 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.

5 months ago

#5 @ramiy
5 months ago

@Cheffheid @afercia, the second patch adds required attribute instead of aria-required.

Note: See TracTickets for help on using tickets.