15 October 2006

Styled Checkboxes and Styled Radio Buttons

Posted by Mikhail Esteves under: Random Websites .

To solve the javascript issue the styled form controls needed to be dynamically inserted into the page using a javascript. No javascript, no change. Original experiments with innerHTML and regExp failed miserably and proved inelegant. However I am still using innerHTML to produce the styled buttons in Internet Explorer.

To solve the CSS problem the styled form controls needed to be invisible with CSS disabled, and likewise the unstyled controls needed to be visible. This was achieved by hiding the unstyled controls with CSS and using a plain Anchor with background images to act as the new control.

To solve the accessibility issues the Anchor comes into play once more. Because it is an Anchor it can be tabbed into and manipulated with keyboard commands and/or clicked.

90% of the code bulk is shoved aside into a javascript, with only well-formed XHTML and wrapping span tags with specific classes assigned to mark up the fields we want styled.



Leave a Reply

Browse

Photography

Projects

Pages

Calendar

October 2006
M T W T F S S
« Sep   Nov »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Categories

www.flickr.com

Use OpenDNS