PDA

View Full Version : Background image in a select box?



Pol NRG
02-07-2005, 12:59 PM
Hello everybody,

Is it possible to insert a background image in a select box form?

Thanks in advance,
Pol

mwinter
02-07-2005, 01:38 PM
Is it possible to insert a background image in a select box form?Please be more careful with how you phrase a question. To me "select box form" would mean the form that contained a select box, which is probably not what you meant.

The answer - in any case - is yes, however whether it works in a particular user agent is a different proposition altogether. With IE, it will not. There is no workaround.

Add the background as you would to any other element using the background CSS property.

Mike

Pol NRG
02-08-2005, 10:14 PM
Hi Mike,

Thanks for your answer and excuse me for my english ;)

All the best!
Pol

Bytrix
03-23-2005, 10:58 AM
There is a way if you want to get into javascript, I wrote myself a custom javascript selectbox using floating divs which updated the value of a hidden input field. I rewrote most of the basic form elements this way so I could use custom images for them.

mwinter
03-23-2005, 11:31 AM
There is a way if you want to get into javascript, I wrote myself a custom javascript selectbox using floating divs which updated the value of a hidden input field. I rewrote most of the basic form elements this way so I could use custom images for them.However, your users could be rather screwed if they don't have scripting enabled (or the necessary scripting support) and you didn't include a decent fallback.

I really don't think going to such lengths is worth the effort at all. It's a form control, for goodness sake.

Mike