PDA

View Full Version : Change Content based on form


bigfoot
04-04-2007, 02:58 PM
I'd like to have a form that changes the background image of the table it's in, depending on what's selected.

For example, a drop-down field, inside a table, with the options 'white', 'black', 'yellow', etc... and if 'yellow' is selected, I want the background image of that table to change to a .jpg image I had created that's yellow. If the user picks 'black' it will again change to a different .jpg that I had created, etc.

I'm not sure if this is best served with jscript, or not...

Thanks

Bigfoot

Jon Hanlon
04-04-2007, 09:27 PM
You can do that with JS and CSS.
Search Google, there are heaps of examples

bigfoot
04-05-2007, 11:27 AM
Thanks, it took a little tweaking to get what I wanted, but these two ideas worked for me:

http://www.askthecssguy.com/2007/01/

http://codepunk.hardwar.org.uk/ajs29.htm