Disabled buttons don’t reduce errors. They make users spend time guessing what’s wrong!
Even dough you may think that the best errors are the ones the user never sees, disabling HTML buttons can be very detrimental to the user experience.
Here are some reasons why disabling HTML buttons can lead to frustration and bad UI:
- disabled buttons don’t give feedback. When a form has errors then the user can look at the form fields, spot the problem and fix it
- disabled buttons are hard to see because of the low contrast.
- disabled buttons are not focusable using the TAB key, therefore not being accessible by visually impaired or keyboard users
- disabled buttons can make the interface frustrating. For example, if the form has 2 errors and the user has provided just one valid answer and the button still stays disabled then this will generate a lot of confusion as the user may think the form should be valid
- on mobile devices users may not notice the disabled button has become enabled if the button is not in the viewport
So, just don't start from this state:
<button disabled> Login </button>
Instead try to write clear label and hint text and enable the button so that the users can get feedback.
Learn by doing with this FREE ebook! Not sure what to build? Dive in with 50 projects with project briefs and wireframes! Choose from 8 project categories and get started right away.