View Single Post
  #8 (permalink)  
Old Jan 1st, 2007, 01:12
Ryan Fait's Avatar
Ryan Fait Ryan Fait is offline
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Any way to use an image for a radio button?

I've made custom radio boxes before. Let me see if I can explain this clearly:

I started out with three instances of a radio button - off, active and selected. For the HTML, I made a <div> with a CSS background image of the radio button and a hidden radio button element inside. Using JavaScript, I wrote a quick little function that switched the background and told the radio button to be selected when the user clicked on the <div>.

Understand? The only problem is that is uses JavaScript. It wouldn't be too difficult to make it still work without the extra styling if JS was disabled, though.
Reply With Quote