 |

gkornbluth
User
Nov 13, 2008, 9:01 AM
Post #1 of 3
(161 views)
Shortcut
|
|
Help with setting up if then conditions
|
Can't Post
|
|
Yet again I find myself needing a bit of help. Here’s what I’ve done: I’ve set up a multi record section editor and have included a pull down list field with a list of categories. IE: “book, CD, Magazine, etc. (BTW, what’s the difference between a simple pull down list and a multi value pull down list?) Here’s what I’m trying to do: On my details page, if the group_code of the particular record is “book” then I would like to display field “A”, if it’s “CD” I’d like to display field “B”, if it’s “magazine” I’d like to display field “C”, and if it’s none of those I’d like to display field “D”. I’ve looked around on the forum but I’m still a bit confused. Thanks, Jerry Kornbluth
|
|
|  |
 |

Dave
Staff
/ Moderator

Nov 14, 2008, 3:34 PM
Post #2 of 3
(143 views)
Shortcut
|
|
Re: [gkornbluth] Help with setting up if then conditions
[In reply to]
|
Can't Post
|
|
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
|
|
|  |
 |

gkornbluth
User
Nov 15, 2008, 4:56 AM
Post #3 of 3
(137 views)
Shortcut
|
|
Re: [Dave] Help with setting up if then conditions
[In reply to]
|
Can't Post
|
|
Thanks Dave, As always... The devil is in the details. And as always, your help is invaluable... Jerry
|
|
|  |
|