Last Updated on
I use the free version of the excellent Mailchimp for WP plugin to allow visitors to this site to sign up for my Magical Brucie Mail and get my Reading List delivered to their inboxes.
When I did my regular accessibility check-up (a FastPass with the splendid Accessibility Insights for Web Chromium plugin by Microsoft) I noticed that the Mailchimp signup form fails two WCAG guidelines:
label: Form elements must have labels (1) WCAG 1.3.1, WCAG 3.3.2
This is because the out-of-the-box default form doesn’t associate its email input with a label:
<p> <label>Email address:</label> <input type="email" name="EMAIL" required /> </p>
I’ve raised an issue on GitHub. Update, 6 Sept: the change was turned down.
Luckily, the plugin allows you to customise the default form. So I’ve configured the plugin to associate the label and input by nesting the input inside the label. (This is more robust than using the IDref way because it’s not susceptible to Metadata partial copy-paste necrosis. (I also killed the placeholder attribute because I think it’s worthless on a single-input form.)
You can do this by choosing “Mailchimp for WP” in your WordPress dashboard’s sidebar, choosing “Form” and then over-riding the default with this:
<p> <label>Email address: <input type="email" name="EMAIL" required /> </label> </p> <p> <input type="submit" value="Sign up" /> </p>