Harvard Extension School
CSCI E-12 Fundamentals of Web Site Development | Fall 2019

## Disabled Form Input Elements

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
--- | ---
    <input disabled="disabled" type="submit"/>
    <input disabled type="submit">

Disabled "submit" input:

Enabled "submit" input:

### Disabled Form Components

HTML Form with basic components
Basic Form

HTML Form with basic components disabled
Basic Form Disabled

Copyright © David Heitmeyer