Re: Easy change look of checkboxes and radiobuttons

2013-05-02 2:01, Silvan Laube wrote:

> I am missing an easy way to  change the looks of form controls such as
 > checkboxes and radiobuttons, as it is a very common request. Is there
 > such a thing planned for HMTL5? I couldnt find anything so far.
 > Basically I want to be able to set a custom picture for the controls.
 > would be awesome.

If such a feature would be regarded as desirable, then a natural way to 
extend HTML that way would be to allow type=checkbox and 
type=radiobutton in <button>. If an element so defined would have 
functionality specified as for corresponding <input> elements, you could 
simply put an <img> inside <button> in your case.

However, this would be added complexity with no strong reason. It is 
already possible to achieve the goal in two ways:
1) use <input> and hide it visually, overlaying an image in its place
2) use <span>, <a>, <button type=button>, <img>, or some other element 
and associate the desired functionality with it using JavaScript.
Even though these have their practical problems and some awkwardness, I 
don't think the best way to deal with the issue is to extend HTML but 
instead
3) extend CSS with a way of specifying the visual appearance of a 
checkbox or a radio button.
This would be better in accordance with the trend of delegating visual 
rendering to CSS and a simpler process, as it could be part of a 
suitable CSS3 "module". It would also automatically degrade gracefully.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Received on Saturday, 4 May 2013 07:03:14 UTC