[whatwg] Can we make checkboxes readonly?

Markus Ernst derernst at gmx.ch
Wed Jul 11 06:35:38 PDT 2012


Am 11.07.2012 00:59 schrieb Ian Hickson:
> On Fri, 4 May 2012, Tab Atkins Jr. wrote:
>> On Wed, May 2, 2012 at 3:57 PM, Ian Hickson<ian at hixie.ch>  wrote:
>>> On Wed, 6 Apr 2011, Tab Atkins Jr. wrote:
>>>> An app may dynamically set inputs or groups of inputs to readonly
>>>> based on app state.  When you submit, though, it's impossible to
>>>> tell (without hacks) whether a checkbox was checked-but-disabled or
>>>> just unchecked. Handling the form data is *much* easier if you just
>>>> get all the data, regardless of whether, as a UI convenience, your
>>>> app temporarily set some of the inputs to readonly.
>>>
>>> That's a use case for submitting disabled check boxes, not for
>>> read-only checkboxes, IMHO. (The same could be said for disabled text
>>> controls.)
>>
>> That's more-or-less what @readonly does - the input becomes "disabled"
>> but still submits.
>
> That's part of what it does, but not the main thing it does. It's mainly a
> UI affordance, which doesn't apply to check boxes.

Given that there are valid use cases for submitting values of elements 
that have a disabled resp. readonly behaviour in the UI: Would it do any 
_harm_ to allow @readonly to checkboxes and radio buttons? I assume this 
would be easy and possible without breaking existing content. Submitting 
disabled elements, OTOH, looks to me like an impossible change, as it 
would likely break existing content.



More information about the whatwg mailing list