Re: [whatwg] Can we make checkboxes readonly?

On Thu, 3 May 2012, Shaun Moss wrote:
>
> An obvious use case for readonly checkboxes came up a few weeks ago when 
> I made this page: http://marssociety.org.au/membership
> 
> The checklist at the bottom I could have made more simply/cheaply with 
> readonly checkboxes. However I had to use images.

Those aren't check boxes, so it seems entirely correct that you not use 
the <input type=checkbox> element for them. It would be like using <input 
type=text> for the cells in the second column of that table, or <input 
type=number> for the cells in the first column.


On Fri, 4 May 2012, Tab Atkins Jr. wrote:
> On Wed, May 2, 2012 at 3:57 PM, Ian Hickson <ian@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.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 10 July 2012 22:59:30 UTC