[thelist] FireFox doesn't do backgroundColor for checkboxesorradios?

Dave Merrill dmerrill at usa.net
Wed Feb 9 06:33:10 CST 2005

Agreed, IE's idea of this isn't exactly gorgeous.

OTOH, it isn't about aesthetics in this case. This is part of a form
validation library, to highlight fields with entry problems (like not being
filled in if required). If it's ugly for a minute, that's ok, as long as it
points the user in the right direction. But it seems confusing to highlight
some invalid fields and not others (like checkboxes and radios).

So what's the alternative? The library does support specifying other
object(s) to highlight instead of the field itself. That's usually used to
highlight additional fields according to validation spec'd for one, but I
could make it a policy to always surround checkboxes and radios with a
fieldset or span, and highlight that. Seems gross.

Another possibility is to abandon highlighting altogether, in favor of an
icon or msg that gets inserted into the document, maybe to the right of the
actual field. That can make a mess of a dense layout though. I could adopt a
standard of always using a '<label for' on each field, and highlighting
that. Anyone know if there's any css relation between a field and its
'<label for'?

Any other ideas? What do you all do to indicate invalid fields to the user?

Dave Merrill

> [snip]
> > It appears that FireFox 1.0 win doesn't support
> > backgroundColor for checkboxes or radios. Test snippets:
> .
> .
> .
> > Radios act the same as checkboxes. IE6 and Opera75 win both
> > do the right things, FireFox 1.0 doesn't.
> [/snip]
> True, FF doesn't seem to support it, but are you sure that IE does the
> right thing?  The background colour goes *around* the checkbox in IE,
> which, IMHO, looks pretty nasty.  Opera gets it right (at least it looks
> how I'd expect it to, not having read any specs. for this) but with IE
> making such a hash of it I've always decided to leave it as default.
> I'd say FF is far more graceful in failure than IE.  If IE got it wrong
> in the same way as FF, I would use background colours for checkboxes.
> Dan

More information about the thelist mailing list