Search topics
Disabled buttons that can't be found or say why
A Place order button is greyed out until the terms box is ticked, but it is either announced as ready or skipped by Tab, and nothing says what is missing.
<button type="submit" disabled>Place order</button> The problem
Keyboard and screen reader users either hear that a greyed-out button is ready when it isn't, or never find it, and nobody is told what they still need to do
A checkout ends with a box to tick, "I accept the terms", and a Place order button below it. Until the box is ticked, the button is grey. A sighted mouse user may guess that the box is holding it back. Others can't.
On one site the button is grey only because of a class. A screen reader user tabs to it and hears "Place order, button", which sounds ready. A click does nothing, because the class turns pointer events off, but Enter still submits the form, and the order comes back with an error at the top of the page. On another site the button has the disabled attribute. A keyboard user tabs from the checkbox straight to the "Delivery and returns" link below, and never lands on the button at all. A screen reader user moving with Tab never hears that there is a button, and nothing on the page says what is missing.
The same thing happens with any action that waits for something: Next on a step that isn't complete, Save on a form with no changes, Add to basket before a size is chosen, Send on an empty message.
Success criterion 4.1.2 requires that the state of a user interface component can be determined by software. Unavailable is a state. When a button is drawn as unavailable but its code says nothing, assistive technology announces it as an ordinary button, and the keyboard still runs it. That is the failure the criterion names.
A button with the disabled attribute exposes its state, so it passes 4.1.2. It still leaves people stuck. Browsers take it out of the Tab order and draw it faint, and WCAG sets no contrast for disabled controls, so a person may never find the button or read its label. The topic asks for more than the criterion: that the control can be found, and that it says why it is disabled.
The barrier comes at the end of a task, after the person has filled in everything else. A long form on a phone hides the checkbox above the fold, so even a sighted person may see only the grey button.
4 of 10 groups affected
- No vision (affected)
- Low vision (affected)
- Colour vision (not affected)
- No hearing (not affected)
- Hard of hearing (not affected)
- No speech (not affected)
- Motor (affected)
- Reach, strength (not affected)
- Cognitive (affected)
- Seizures (not affected)
- Limited manipulation Keyboard users either reach a button that ignores the mouse but still submits on Enter, or move straight past a disabled one, so they can't tell whether the form is ready.
- Without vision Screen reader users hear "Place order, button" on a button that is greyed out, or, moving with Tab, never meet the disabled button at all, and the reason is never read to them.
- Limited vision Disabled buttons are drawn faint and need no contrast, so people with low vision may not read the label, or see that it changed when the form became ready.
- Limited language, cognitive and learning abilities A grey button with no reason leaves people to work out which field is holding it back, and some give up on the form.
axe and similar tools check that a button has a name and a role. A button greyed out by a class has both, so it passes. A disabled button is skipped by contrast checks on purpose, and nothing asks whether a reason is shown. Code assistants usually reach for the disabled attribute, because it fixes the state, and leave the button unreachable with no reason. When they use aria-disabled, they often forget to block the action, so the button announces "dimmed" and still submits. Tab through the form, then press the button before the form is ready, and see what you are told.
Try it
Before ticking the box, try to place the order with Tab and Enter
Broken 1: press Tab from the checkbox to Place order, then press Enter. Can you reach the button, and does anything tell you what is missing? The panel shows what a screen reader announces.
Broken 2: press Tab from the checkbox to Place order, then press Enter. Can you reach the button, and does anything tell you what is missing?
Apply a fix. Try again before ticking the box: can you reach the button, and does anything tell you what is missing?
Broken Can you fix this?
The fix
Keep the button reachable, and say what is still needed
A button greyed out by a class
<label><input type="checkbox" name="terms"> I accept the terms</label><button type="submit" class="btn is-disabled">Place order</button>What is wrong2 points
- The button looks unavailable, but only the class says so: it is announced as "Place order, button".
pointer-events: nonestops the mouse but not the keyboard, so Enter still submits the form.
A button that stays enabled and explains when pressed
<label><input type="checkbox" name="terms" id="terms" aria-describedby="terms-error"> I accept the terms</label><p id="terms-error" class="error" hidden>Tick the box to accept the terms.</p><button type="submit">Place order</button>How it is fixed4 steps
- Leave the button enabled, with no disabled state at all. It is always reachable, always readable, and always does something.
- Write the error beside the checkbox, hidden, and link it to the checkbox with
aria-describedby. - On submit, if the box isn't ticked, stop the submit, show the error, set
aria-invalidon the checkbox and move focus there. A screen reader reads the label, the invalid state and the error. - When the box is ticked, hide the error and remove
aria-invalid.
This fixes both Befores and passes 4.1.2. There is no disabled state to expose, so there is nothing to get wrong.
Why this fix: Explain instead of disabling
All three pass 4.1.2. Leave the button enabled and explain when it is pressed: it keeps the button where everyone can find and read it, gives a reason only when someone needs one, and uses the error handling the form needs anyway. Use aria-disabled when the design must show that the button isn't ready yet, accepting that the script, not the browser, has to stop the action. Native disabled with a visible reason is the smallest change to an existing disabled button, but people moving with Tab still pass it by, so treat it as a step on the way rather than the end.
A button that is unavailable for a moment, rather than waiting on the person, is a different case. While an order is being sent, keep the button where it is, mark it aria-disabled="true" and ignore further presses, and say "Placing your order" in a status message. A native disabled there drops focus to the page body in some browsers, and the person loses their place.
Disabled links don't exist in HTML. A link with a disabled class is still a link. When a link must not be followed, remove its href, so it is no longer a link or a Tab stop, or turn it into a button with aria-disabled.
aria-disabled and aria-hidden sound alike but do opposite things. aria-disabled="true" keeps the button on screen, in the Tab order and in the accessibility tree, and adds a state that screen readers announce, such as "unavailable" or "dimmed". aria-hidden="true" takes the button and everything inside it out of the accessibility tree, but leaves it on screen and in the Tab order. A keyboard user still lands on it, and what a screen reader says there varies from nothing at all to a bare name. So never use aria-hidden to mark a control unavailable. Use aria-disabled for one that stays on the page, and the hidden attribute for one that should go away for everyone. Focusable elements inside aria-hidden are covered in aria-hidden content that keyboard focus still reaches.
The faded look is where the contrast goes. Disabled controls are exempt from the contrast criteria, but the exemption doesn't make them readable. Draw an unavailable button with readable text and change something besides colour, such as a dashed border. Native disabled buttons are drawn in GrayText in forced colors; a button styled from aria-disabled loses that look unless you add a forced-colors rule.
Several reasons at once need several messages. When Place order waits for a delivery slot and the terms, list both beside the button, or let the enabled button show an error summary of everything that is missing, as in error summaries that list every problem. See form errors that say what went wrong for the error beside each field.
Component libraries often expose a disabled prop that sets the attribute and an option, such as focusableWhenDisabled, that sets aria-disabled instead. Check which one the shared button uses, and which element in it takes focus.
Design ideas
A button that isn’t ready can still say why
Four ways to draw Place order while it can’t go yet. In the first two the terms box is empty: press the button, then tick the box and press again. In the last two it is ticked: press Place order, then press Enter again while it is sending. Three say what is happening; the last looks busy, but a second press sends a second order.
In the design file
- Draw how Place order looks before it can be used. Keep the text easy to read, and change more than the colour, such as a dashed border.
- Write next to the button what people need to do, such as “Tick the box to accept the terms”.
- Write the greyed-out text’s contrast ratio next to its colour, and keep it readable. WCAG sets no minimum for unavailable buttons; the example here has 5.99:1.
- Draw the button in a Windows contrast theme, where it must still look like a button and still look unavailable.
Passes
- A button that says what it needs An outlined pill, its 2px edge and label in #2b2724 at 14.81:1, reads “Accept the terms to order”, then fills in as Place order once the box is ticked. The reason is the label, so there is no hint to find, at the cost of a longer button while it waits.
- A checklist above the button A soft #f4f1ed card lists what the order still needs, in #2b2724 at 13.15:1: a ticked circle for the delivery slot, an empty one for the terms, and the words change too, so it doesn’t rest on colour. People see what is left before they press, and it grows to any number of steps; it costs a few lines above the button.
Rule of thumb: Explain instead of disabling
- Spinner in a button that keeps its place Pressed, Place order keeps its shape, place and label, white on #2b2724 at 14.81:1, with a small spinner, and a line under it says “Placing your order…”. It is marked unavailable while it sends, so it is announced that way and a second press sends nothing; the spinner stops when the order is placed, after 2 seconds here.
Rule of thumb: Style from the state, not a class
Fails
- Button that shrinks into a spinnerWCAG 4.1.2 Pressed, the pill shrinks to a 44px circle with a spinner, and only a class says it is busy. It is still announced as “Place order, button”, and Enter on it while it spins sends a second order.
Verify the fix
6 checks, no mouse.
Test with: Keyboard, Screen reader, Forced colors, Zoom
Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the shared button component changes.
How screen readers handle aria-describedby
Limits
This is a starting pattern, not a guarantee for every form. Screen readers word aria-disabled and disabled differently ("dimmed", "unavailable", "disabled"), and some read aria-describedby only after a pause or on request. The error wording and its place on the page depend on the rest of your form. Test the whole journey, from an empty form to a placed order, with the assistive technology your users have.
This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.
EaseWeb service
Fixed it? Keep it from coming back.
I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.