Images in HTML select form elements?
March 10, 2005 9:52 AM
Subscribe
Is it possible to have an HTML select form element display images for each choice rather than text?
From what I can tell, it's not. It seems someone would have a work-around, but I can't find it. I'd like the select element to display images, but return the filename when the form is submitted. The images are all tiny gifs and/or pngs sitting in a directory all to themselves. I'm programming in PHP & smarty. A javascript solution would be fine.
posted by ewagoner to computers & internet (5 comments total)
It would require a hidden field which is populated when an item in the list is selected (onclick="populateHiddenField("theValue");").
You're likely stuck with the select box, but if you're not, a group of radio buttons would give you less grief and return the same data.
posted by o2b at 10:04 AM on March 10, 2005