Disabled form elements are used to show something is there, but not currently active.
For example, a form submit might be inactive unless the user has agreed to terms. For that example, we'd need to use JavaScript to change the "disabled" state of the submit input element based on whether the "agree" radio button is selected.
disabled vs disabled="disabled". Note that in the "XML" form of HTML5, the disabled attribute has to have a value, where as in the HTML form of HTML5, the disabled attribute can be on its own.
XML form of HTML5 | HTML form of HTML5 |
---|---|
|
|
Disabled "submit" input:
Enabled "submit" input:
HTML Form with basic components
Basic Form
HTML Form with basic components disabled
Basic Form Disabled
Copyright © David Heitmeyer