Values of disabled inputs will not be submitted
disabled
input will not submit data.
Use the readonly
attribute:
<input type="text" readonly />
Source here
Yes, all browsers should not submit the disabled inputs, as they are read-only.
More information (section 17.12.1)
Attribute definitions
disabled [CI] When set for a form control, this Boolean attribute disables the control for user input. When set, the disabled attribute has the following effects on an element:
- Disabled controls do not receive focus.
- Disabled controls are skipped in tabbing navigation.
- Disabled controls cannot be successful.
The following elements support the disabled attribute: BUTTON, INPUT, OPTGROUP, OPTION, SELECT, and TEXTAREA.
This attribute is inherited but local declarations override the inherited value.
How disabled elements are rendered depends on the user agent. For example, some user agents "gray out" disabled menu items, button labels, etc.
In this example, the INPUT element is disabled. Therefore, it cannot receive user input nor will its value be submitted with the form.
<INPUT disabled name="fred" value="stone">
Note. The only way to modify dynamically the value of the disabled attribute is through a script.
You can use three things to mimic disabled:
HTML:
readonly
attribute (so that the value present in input can be used on form submission. Also the user can't change the input value)CSS:
'pointer-events':'none'
(blocking the user from clicking the input)HTML:
tabindex="-1"
(blocking the user to navigate to the input from the keyboard)
They don't get submitted, because that's what it says in the W3C specification.
17.13.2 Successful controls
A successful control is "valid" for submission. [snip]
- Controls that are disabled cannot be successful.
In other words, the specification says that controls that are disabled are considered invalid for submission.