The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Accessibility Labels for Required Fields

Labels

This Discussion is public

Notifications

I am attempting to add necessary accessibility label functionality to meet legal ADA compliance for web forms on our website, which is currently missing from the form fields.

I was able to add a hook to my functions.php file for the add_input_html function to add "aria-required=true" and "aria-invalid=false" (by-default setting) to required form fields, but am having difficulty dynamically changing aria-invalid to "true" when the error is appended below the field, and resetting back to false when the error is corrected and removed.

Thank you so much for your help.