Don't disable buttons
Don't disable buttons
One of the most common accessibility issues I find (and fix) on client projects is dynamically disabled form buttons when a form is being submitted. Today I want to talk about why developers do it, why it’s bad, and what you can do instead. Let’s dig in! Why developers disable buttons Typically, I s...
The article discusses why developers commonly disable form buttons during submission to prevent duplicate requests, but how this creates accessibility issues. While disabling buttons may seem to prevent resubmission, users can still submit the form via keyboard. A better approach is to add a "data-submitting" attribute to the form during submission processing as this preserves focus without breaking functionality or accessibility.
The article also recommends including ARIA live regions and status messages to keep users informed.