HTML5: disabled vs. readonly form fields

Posted Over 6 years ago. Visible to the public. Repeats.

Form fields can be rendered as noneditable by setting the disabled or the readonly attribute. Be aware of the differences:

disabled fields

  • don’t post to the server
  • don’t get focus
  • are skipped while tab navigation
  • available for button, fieldset, input, select, textarea, command, keygen, optgroup, option

Browser specific behavior:

readonly fields

  • post to the server
  • get focus
  • are included while tab navigation
  • only available for input[type=text], textarea
Natalie Zeumann
Last edit
About 6 years ago
Henning Koch
License
Source code in this card is licensed under the MIT License.
Posted by Natalie Zeumann to makandra dev (2018-02-08 09:25)