Hoppa över navigering, gå direkt till textinnehållet



Styled checkboxes and radiobuttons

With the use of CSS and unobtrusive javascript we can do exactly what we want with checkboxes and radiobuttons.

With something as simple as

  1. <input class="heart" type="checkbox" name="input-name" />

we replace the checkbox with an image of a heart instead.

The javascript is released here

This work is inspired by Philip Howards Styled Form Controls.

The reason I did this script was because I wasn’t realy satisfied with Philips solution of adding some extra markup, and that the span needs the attribute name. This will cause this script to fail when we try to validate it throw the W3C validator.

Since I was in a little rush to release this before my trip to Berlin I have just test it in Firefox 1.0.6 and Internet Explorer 6.0.

I havent figure out how to get labels to work with the fields yet, but I did some testing and just commented out that lines, so if you feel like debugging this please do!

Elin sa,
8. september 2005, 10:50
Meh! “Jag gillar…” alla förutom elin.systrar.net :(
roblibob sa,
15. september 2005, 11:26
Han vill inte förknippas med dina värderingar, überkapitalist som han är ;-)

Off to BerlinUpdated my Textpattern Install