Show the expected format with an example
Tell the reader what shape the answer takes before they get it wrong. G89 puts the format into the label, or into text right beside the field, ideally with a sample they can copy. W3C counts it as sufficient for the labels-and-instructions rule at Level A when it is used alongside descriptive labels, and separately as sufficient for its Level AAA help rule. So a format hint and a real label are a pair rather than two alternatives. This is also the cheapest accessibility work available, because it stops an error happening rather than explaining one afterwards. Where a format has common variations, dates being the obvious case, offering a preference so the reader can use the one they think in is better again.
How we find it in an audit
Every field carrying a restriction gets checked for whether that restriction is stated before submission rather than after it. Dates, phone numbers, postcodes, passwords with rules, reference numbers. The hint has to be reachable too, so we test whether a screen reader announces it on focus, which usually means it is tied to the field with aria-describedby rather than sitting loose alongside. Placeholder-only hints get flagged, because a placeholder vanishes the moment somebody starts typing, which is exactly when it was needed.
How affected users experience it
A sighted user glances at the grey text under the field and adjusts without thinking about it. A screen-reader user hears the hint only if the code ties it to the field, and where it does not, the first they learn of the format is the error message. Somebody with a cognitive disability or a memory difference needs that hint still visible while they type, which is the argument against hiding it in the placeholder. Both problems close with one attribute and one line of visible text.
Passes vs. fails
Passes
Booking reference, two letters then six digits, like AB123456. The hint is tied on with aria-describedby and announced on focus.
Fails
Booking reference, with no hint at all, so the format of two letters then six digits is revealed only by failing.
Other ways to satisfy this rule
17 guides on this site are filed under 3.3.2 Labels or Instructions. W3C lists this one as sufficient for that rule only alongside G131, so the pair is what passes and neither half does on its own.
- ARIA1sufficientAttach help text to inputs with aria-describedby
- ARIA9sufficientAssemble one label from several text pieces
- ARIA17sufficientGroup related form fields with ARIA roles
- G83sufficientTell users which required fields they missed
- G131sufficientWrite labels that describe their fields
- G162sufficientPosition labels where users expect them
This guide is our interpretation of W3C technique G89: Providing expected data format and example. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.