Image from pulldown menu

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 3, 2008   (RSS)

By ethan76 - June 3, 2008

Hi,

I'm just getting into CMS builder and can already say I think it's great!

There's one thing I'd like to do and can't yet find a work-around though.

I want to have the user select one of three options in a pull down menu, and then on the live page for this to appear as an image, rather than type.

So, I have three options;

Road Legal
Off road
Kid's Quads

Can I alter the code on the page so that - depending on what's chosen - an image changes?

Probably a real noob queston - any help very appreciated!

Thanks, Ethan

Re: [ethan76] Image from pulldown menu

By Dave - June 3, 2008

Ethan, welcome to the CMS Builder forum! :)

The simplest way to do that would be with a PHP if statement like this:

<?php if ($record['yourField'] == "Road Legal"): ?>
Show Image 1
<?php endif ?>

<?php if ($record['yourField'] == "Off Road"): ?>
Show Image 2
<?php endif ?>

<?php if ($record['yourField'] == "Kid's Quads"): ?>
Show Image 3
<?php endif ?>


But use your own variable and fieldname instead of $record['yourField']. Give that a try and let me know if it does what you need.
Dave Edis - Senior Developer
interactivetools.com