The Worst Form Of Forms . this is bad practice.
Let's take a look at this example, which I consider to be the least accessible form you could design.
Now, why is this so bad?
A rather big problem: our checkbox doesn't have a name at all. It's simply "checkbox unchecked"! How would a blind user be expected to know what the checkbox actually does?
Not only is this less accessible to people reliant on screen readers, sighted folks don't fare much better. Imagine having limited short-term memory or anxiety needing to double-check all inputs before sending. You would not have any indication to see whether you mixed up the email and subject or not. It would be necessary to empty each field and retype it to see what parameter is being edited.
On top of all that, the form itself is unnamed. Navigating to it doesn't create any narration, so the purpose of the form is only clear to sighted users.
Labels To The Rescue . this is ok practice.
A step towards improved accessibility will be the inclusion of input labels. HTML provides label elements to not just display and announce an associated text for an input but also extend the input's clickable area to that text, which can be a boon to people with motor skill problems.
Stop Saying Asterisk . this is good practice.
You may have noticed our narrator always announcing the asterisk.
Let's prevent that with aria-hidden="true"
and actually give a proper meaning for them!
Giving A Name To The Form . this is best practice.
Lastly, we want our form to have a name of its own. We can achieve that by adding an ARIA label
or using aria-labelledby
.
Well done! Our form is now much more accessible.