HTML <input> Tag with the 'disabled' Attribute

<form id="myForm" action="http://www.PuStudy.Com/resources/html-forms-action.html">

<input name="input1">
<input name="input2" disabled>
<input name="input3">

<button>Submit</button>
</form>

In the above example we add the disabled attribute to an input control. The disabled attribute can be used to disable a form control so that the user can't select it and its value isn't submitted with the form.

The above example has three input controls, with the second control being disabled.

About the disabled Attribute

The autofocus attribute disables the control. Therefore, if the user tries to use the control, nothing will happen.

This attribute is a boolean attribute. Therefore, if it is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace (i.e. either disabled or disabled="disabled").

Possible values:

  • [Empty string]
  • disabled