Let Wufoo do the hard work. Sign up for a free account and start making forms the easy way.
Live Demo
Firefox | Safari | Safari | Chrome 10+ | Opera | IE | Android |
|---|---|---|---|---|---|---|
The Low Down
The disabled attribute makes the <input>, <textarea>, and <fieldset> descendants non-editable and excludes the disabled form control data from being sent to the server.
- If the
disabledattribute is set on a<fieldset>, the descendent form controls are disabled. - A disabled field can’t be modified, tabbed to, highlighted, or have its contents copied. Its value is also ignored when the form goes thru constraint validation.
- The disabled value is Boolean, and therefore doesn’t need a value. But, if you must, you can include
disabled="disabled". - Setting the value of the
disabledattribute to null does not remove the effects of the attribute. Instead useremoveAttribute('disabled'). - You can target elements that are disabled with the
:disabledpseudo-class. Or, if you want to specifically target the presence of the attribute, you can useinput[disabled]. Similarly, you can use:enabledandinput:not([disabled])to target elements that are not disabled. - You do not need to include
aria-disabled="true"when including thedisabledattribute because disabled is already well supported. However, if you are programmatically disabling an element that is not a form control and therefore thedisabledattribute does not apply, includearia-disabled="true". - The
disabledattribute is valid for all form controls including all<input>types,<textarea>, <button>, <select>, <fieldset>, and<keygen>.