Help with setting up if then conditions

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

Re: [gkornbluth] Help with setting up if then conditions

By Dave - November 14, 2008

Hi Jerry,

>what’s the difference between a simple pull down list and a multi value pull down list?

If you hold down ctrl you can select multiple values in a multi value pull down list.

Try this for your if code, I'll assume group_code is $record['group_code'] but just use whatever variable you have:

<?php if ($record['group_code'] == "book"): ?>
<?php echo $record['fieldA'] ?>
<?php else if ($record['group_code'] == "CD"): ?>
<?php echo $record['fieldB'] ?>
<?php else if ($record['group_code'] == "Magazine"): ?>
<?php echo $record['fieldC'] ?>
<?php else: ?>
<?php echo $record['fieldD'] ?>
Sorry, couldn't find a match for '<?php echo $record['group_code'] ?>'
<?php endif ?>


Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Help with setting up if then conditions

By gkornbluth - November 15, 2008

Thanks Dave,

As always... The devil is in the details.

And as always, your help is invaluable...

Jerry
The first CMS Builder reference book is now available on-line!

Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php