Clicking submit is the moment a form visitor is most exposed to doubt. They pressed the button, the page has not moved, and nothing has been said. The instinct is to fix this with disabled on the button, and that is exactly where form submit button disabled state accessibility goes wrong: the native disabled attribute removes the button from the Tab order and quietly changes what Enter does inside the form. This article shows a safer pattern — a busy state that keeps the button reachable, announces progress once, preserves validation feedback and still prevents a duplicate send.
It assumes you already have a working HTML form and only want to change the submit button's behavior. If the form itself needs shaping, start with HTML form labels that make lead forms clear and contact form error messages that help visitors fix and resubmit.
Why the button should not vanish, go silent, or use native disabled
An HTML form is a request builder. The action and method attributes decide where and how the data leaves the page, and a submit button triggers that request. MDN's guide to sending and retrieving form data describes the form as a convenient, user-friendly way to configure an HTTP request, with the server responding and usually causing a page load. When your script intercepts the submit event and sends asynchronously instead, you take over everything the page load used to communicate: that something happened, that it is still happening, and what to do if it failed.
Three anti-patterns dominate:
- Removing the button after the click, which pulls the focus target out from under a keyboard user.
- Setting the native
disabledattribute, which takes the button out of sequence and means pressing Enter in a text field no longer submits the form. - Leaving the button untouched, letting repeat clicks fire several requests — the very problem the other two were trying to solve.
A complete answer keeps the button in place, changes its visible meaning, says the change out loud, refuses a second send, and returns to a usable state when something goes wrong.
What native validation does before your handler runs
Order matters. Browsers run constraint validation first: attributes such as required, type, pattern, minlength and min are checked, and if a field is invalid the browser blocks submission and shows its own message. MDN's guide to client-side form validation makes two points worth repeating: catching invalid data on the client lets the user fix it straight away instead of after a server round trip, and client-side validation is not an exhaustive security measure, so server-side validation is still required.
Practically, your submit handler only runs after native validation passes. If a visitor presses Enter with an empty required field, no request is in flight, so your busy state must not activate. A "Sending…" label sitting next to a "Please fill out this field" message is a contradiction the visitor has to resolve in their head.
Start your work inside the submit event rather than a bare click handler, and call form.checkValidity() if you ever submit programmatically.
The busy state pattern: keep it focusable, change its meaning
Use aria-disabled and aria-busy plus a visible label change, not the native attribute. The control stays a real, focusable <button type="submit">, so Tab still reaches it and Enter still submits from other fields; it simply reports that it cannot currently be actioned.
<form id="contact-form" action="/contact" method="post">
<label for="email">Email address</label>
<input id="email" name="email" type="email" required autocomplete="email" />
<button type="submit" id="send" aria-busy="false">Send message</button>
<p id="form-status" role="status" aria-live="polite" aria-atomic="true"></p>
</form>
const form = document.getElementById('contact-form');
const send = document.getElementById('send');
const live = document.getElementById('form-status');
let inFlight = false;
form.addEventListener('submit', async (event) => {
event.preventDefault();
if (inFlight) return; // the real double-submit guard
inFlight = true;
send.setAttribute('aria-disabled', 'true');
send.setAttribute('aria-busy', 'true');
send.textContent = 'Sending…';
live.textContent = 'Sending your message.';
try {
const response = await fetch(form.action, { method: 'POST', body: new FormData(form) });
if (!response.ok) throw new Error('Request failed');
send.textContent = 'Message sent';
send.setAttribute('aria-busy', 'false');
live.textContent = 'Your message was sent.';
} catch (error) {
inFlight = false; // allow a retry
send.removeAttribute('aria-disabled');
send.setAttribute('aria-busy', 'false');
send.textContent = 'Send message';
live.textContent = 'Sorry, your message was not sent. Please try again.';
}
});
Two details are easy to miss. The inFlight flag does the enforcement; the ARIA attributes only communicate. And on failure you must clear both the flag and the visual state, or a visitor is locked out of resubmitting after a network hiccup.
Style the busy state so it is seen as well as announced. A dimmed fill plus a spinner is fine; a spinner alone is not, because not every visitor perceives motion. If you animate it, respect prefers-reduced-motion as you would for any looping animation.
Announcing the change without flooding the screen reader
Screen readers do not re-announce a button whose label changed unless focus is on that button or the change lands in a live region. If the visitor pressed Enter from the email field, focus is not on the button, so the label swap alone is silent. That is what the region is for.
role="status" with aria-live="polite" waits for the user to pause before speaking, which suits "Sending your message." A polite announcement is right here; assertive interruptions are better reserved for urgent errors that block progress.
Wording rules that keep the region calm:
- Announce the start once, not on every tick.
- Announce only the outcome, short and factual: sent, or not sent with a retry cue.
- Do not repeat field-level validation in this region as well as inline; the inline error tied to the field is the right home, and duplicating it creates double speech. The native validation message customization guide covers where per-field messages belong.
- Replace the region text rather than appending, so it does not grow into a wall of history.
- If the outcome replaces the whole form with a confirmation panel, move focus to that panel's heading with
tabindex="-1". The contact form redirect and confirmation comparison weighs that path against a redirect.
The W3C's Dialog (Modal) Pattern explains the same instinct: when a dialog opens, focus moves to an element inside it, and when it closes, focus returns to the element that invoked it. Any confirmation surface you reveal after submission deserves the same care, so focus does not sit on a control that is now hidden.
Keeping validation errors alive while a request is in flight
The most common busy-state bug is losing validation feedback the moment the state starts. If your script disables inputs or clears error text when it sends, a server-side rejection has nowhere friendly to report back to.
The rule: while the request is in flight, change only the submit button and the live region. Leave every input, its value and its error text exactly as they were. If the server returns validation errors, show them through the inline pattern the visitor already understands, keep what they typed, and reset the button so they can correct and resubmit.
If you do make inputs read-only during the request, keep them focusable and readable. But the simpler and safer option is to leave inputs interactive and rely on the inFlight flag to stop a second send.
Preventing double submits without swallowing the first click's feedback
Layering protection is reasonable:
- The JavaScript flag stops a second request while the first is pending.
- The endpoint should be idempotent or reject near-duplicate payloads, since a request can always be replayed outside your UI.
- A honeypot or timing check catches automated submissions without affecting real visitors; the honeypot spam protection walkthrough for existing forms treats that layer separately.
What you must not do is swallow the click silently. If someone taps Send twice quickly, the second tap should do nothing visible because the first tap's feedback is already on screen. Silence reads as "it didn't work, tap harder".
A keyboard and screen reader test script
Run this on the real page with the real server before shipping:
- Tab to the submit button and confirm a visible focus indicator.
- Press Enter twice rapidly with valid data; confirm exactly one request in the Network panel and one busy label.
- Press Enter again while pending; confirm nothing new happens and nothing extra is announced.
- Tab away and back while busy; confirm the button still receives focus.
- With a screen reader on, submit and listen for the sending announcement, then the outcome. Neither should be cut off or repeated.
- Submit with an empty required field; confirm the native error appears, the busy state never activates, and the region stays quiet.
- Force a server error; confirm the button resets, focus is not lost, and the region announces the failure with a retry cue.
- Submit successfully, then reload and confirm the button starts in its normal state.
Any icon inside the button needs an accessible name describing the action, not the spinner.
Where the Detected Form widget fits
The Detected Form widget connects a form you already have to WidgetJar: you configure the widget in the panel, install the embed script on your registered site domain, and the existing form is picked up without a rebuild. Because it changes how submissions are captured, run the test script above immediately after the embed is installed, and again after any configuration change, so the accessible submit behavior you built survives the connection. If autofill quirks affect the same form, the autocomplete off contact form fields guide is a useful companion check.
Open the Detected Form widget settings, confirm the form, then press Enter twice in a real browser and listen to what happens. That one test tells you more than any code review.