Closed yaili closed 5 years ago
This issue overlaps with design for…
Labels: If a required/optional indicator is not part of the label, there needs to be some other way of making the indicator sound as if it is associated with the control. (Simply Accessible provides an example of how absolute positioning could visually separate the indicator from the label while keeping it within the <label>
element. However, it assumes that all required fields — and all other required controls — are the same width.)
Captions: If the required/optional indicator is part of the caption, does this mean every required/optional field must have a caption? …and every required/optional checkbox? That would take up a lot more space.
Error states: If “(Required)” was always spelled out, the unfilled error state could involve simply highlighting that already-present text, rather than adding more text.
Readability: There’s disagreement about the recognizability of field-required symbols, such as red asterisks. And even if they’re recognizable to sighted users, they may be less so to someone using a screenreader. Fortunately, controls can also have the required
attribute which is understood by screenreaders.
Validation: The required
HTML attribute has two other benefits. First, it lets the browser do some of the on-submit validation for you (“Please fill out this field.”). Second, it can be used as a CSS selector: input[required], textarea[required] {outline: solid blue; outline-width: 0 0 0 3px}
. Doing the opposite — styling controls lacking the attribute as optional — would be risky because it would require authors to remember to use the required
attribute for every single required control.
It's been over a year since this issue was reported, our brochure sites and applications have evolved since then so I want to do another audit to see what we're doing 😄 identify a style to add to Vanilla so that we're consistent across our products 👍
#666
grey to differentiate from form labelAs you can see from examples in our applications and sites we're quite inconsistent with variations of use:
We have 3 solutions so it's up to us to decide which is the better one to implement and will work for all use-cases. I will look at other example sites/applications to see other options in the field 👍
Currently using asterix (*) on form labels
'Asterix' added to end of form label
It does increase the attractiveness of the form, but making an Asterix recognisable takes up a lot of space:
Meanwhile, in October, Baymard rewrote their article on this topic: “E-Commerce Checkouts Need to Mark Both Required and Optional Fields Explicitly (Only 14% Do So)”. The highlights:
Now, that research was just on e-commerce checkouts, and we have few of those. Maybe we don’t need a pattern for this — maybe it’s form-specific — but if we do, it’s only necessary beyond some threshold. We’d never need it for a search form, for example, or a sign-in form, or a single-field subscription form.
It does increase the attractiveness of the form, but making an Asterix recognisable takes up a lot of space:
Haha @matthewpaulthomas love it! We can propose this upstream to Vanilla 😉
- In their test of “60 top e-commerce sites”, on the “37% of sites [that] mark only optional fields”, “32% of users during testing had a validation error because they did not complete a required field.”
That's an interesting highlight
- “By explicitly denoting both optional and required fields, users aren’t forced to infer anything and don’t have to look backwards at prior form fields — but can instead stay focused on just the one form field they are filling out.”
Another interesting highlight especially using optional and required fields, for MAAS these are both needed dependant on your configuration.
Maybe we don’t need a pattern for this — maybe it’s form-specific
I agree with you here too and it makes me question which style to move forward with:
- An asterisk is more obvious, but not to everyone, there are always some who do not understand
- Less visual noise on your form makes it more readable and therefore faster to complete
Looking at styling of required/optional in forms on other sites/applications.
Following the discussion on this issue we thought it would be good to investigate the usability and accessibility concerns around indicating optional vs required fields in forms.
Vanilla and ubuntu.com has been indicating optional, whereas MAAS has recently agreed to do the opposite.