required/readonly/disabled Diff Table
Resolves required, readonly and disabled flags for an ordinary input type. Effective disabled includes inherited fieldset state supplied by the caller. Submission eligibility concerns disabling only; name, checkedness and submitter selection are separate.
Description
Required, readonly and disabled express different form-control behavior.
Required, readonly and disabled express different form-control behavior. Attribute applicability depends on input type, and readonly can bar validation without disabling submission.1
Resolves required, readonly and disabled flags for an ordinary input type. Effective disabled includes inherited fieldset state supplied by the caller. Submission eligibility concerns disabling only; name, checkedness and submitter selection are separate.
When to use required/readonly/disabled Diff Table
Use this for the following task: Resolves required, readonly and disabled flags for an ordinary input type. Effective disabled includes inherited fieldset state supplied by the caller. Submission eligibility concerns disabling only; name, checkedness and submitter selection are separate.
Prepare the parsed attribute values, element states or ordered local lists requested below. Keep attribute presence separate from value.
How to use required/readonly/disabled Diff Table and understand its results
- Prepare the parsed attribute values, element states or ordered local lists requested below. Keep attribute presence separate from value.
- Enter type, required, readonly, disabled using the field table, then run the tool.
- Read requiredApplies, readonlyApplies, mutable, excludedByDisabled, barredFromValidation. Interpret flags, units, ordering and placeholder values using the rules below.
- Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| type | Type | string; choose "hidden", "text", "search", "tel", "url", "email", "password", "date", "month", "week", "time", "datetime-local", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button" | Required |
| required | Required | boolean | Required |
| readonly | Readonly | boolean | Required |
| disabled | Disabled | boolean | Required |
Apply readonly to the supported text/date/number types and required to those plus checkbox, radio and file. Determine mutability by type and effective flags. Use caller-supplied inherited disabling in disabled.2
barredFromValidation = disabled OR effectiveReadonly OR type in {hidden, reset, button} This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.
| Output field | Meaning | Value type |
|---|---|---|
| requiredApplies | Required Applies | boolean |
| readonlyApplies | Readonly Applies | boolean |
| mutable | Mutable | boolean |
| excludedByDisabled | Excluded By Disabled | boolean |
| barredFromValidation | Barred From Validation | boolean |
{
"input": {
"type": "text",
"required": true,
"readonly": true,
"disabled": false
},
"output": {
"requiredApplies": true,
"readonlyApplies": true,
"mutable": false,
"excludedByDisabled": false,
"barredFromValidation": true
}
} Limitations and assumptions
Submission exclusion describes disabling only. A name, checkedness, submitter selection and actual validity still need their own checks.
This evaluates supplied local information; it does not fetch a page or run a browser. Malformed requests produce input errors. A successfully evaluated request can still contain false flags, empty result lists or a result outside the supplied threshold; those outcomes have the meanings stated above.
Alternative or Complementary methods
Choose min/max/step Number Input Semantics for this operation: Checks parsed number-input min/max and step constraints using exact decimal arithmetic on the canonical decimal spelling of supplied finite numbers. Supply normalized positive step (default 1) and attribute presence flags; this is an ideal decimal model, independent of browser binary floating point tolerances. For a complementary task, use textarea/input maxlength Parity for this operation: Measures an input or textarea API value in UTF-16 code units against maxlength. Supply the already-normalized API value; this does not model user-edit constraint-validation conditions or grapheme counts.
Further background: HTML / accessibility reference: required/readonly/disabled Diff Table.
References
Similar or alternative tools
- min/max/step Number Input Semantics
Checks parsed number-input min/max and step constraints using exact decimal arithmetic on the canonical decimal spelling of supplied finite numbers. Supply normalized positive step (default 1) and attribute presence flags; this is an ideal decimal model, independent of browser binary floating point tolerances.
- textarea/input maxlength Parity
Measures an input or textarea API value in UTF-16 code units against maxlength. Supply the already-normalized API value; this does not model user-edit constraint-validation conditions or grapheme counts.