The properties of the disabled attribute:
The properties of the readonly attribute:
1 Avoid using a disabled or readonly component in a starting state.
Example scenario:
- A form that contains a user's information. - We do not want to allow the user to change their email address - But they do need to see the email address to ensure it's correct
Usability Issues with this scenario:
- What if it's the wrong email address. If this component is displayed as an input box, the user will assume it is in someway editable. This will frustrate the user as they don't know how to edit the field.
The Solution:
- Show the email address as regular text and provide a help message for how to proceed if the email address is incorrect.
2 Don't disable the submit button