 |

virgodesign
User
Jul 18, 2008, 1:13 PM
Post #1 of 2
(104 views)
Shortcut
|
|
Simple Checkbox to display panels
|
Can't Post
|
|
Hi Dave, I have a simple checkbox field in the editor sections to turn on and off the display of info boxes on the web page: So if the record "info_box_1" is checked for a value of "1" I want to embed some code etc. I think this is most of what I need: <?php if ($record['info_box_1']): ?> Do html stuff here if info_box_1 = a value of 1 <?php endif ?> Thanks Dave Avrom
|
|
|  |
 |

Dave
Staff
/ Moderator

Jul 18, 2008, 3:11 PM
Post #2 of 2
(91 views)
Shortcut
|
|
Re: [virgodesign] Simple Checkbox to display panels
[In reply to]
|
Can't Post
|
|
Hi Avrom, Yes, that's pretty much it. Give it a try and let me know how it goes. Some tips for you to help with debugging. If it's not working try printing out the value of the checkbox: info_box_1: '<?php echo $record['info_box_1']?>' If it's 0 or 1 you can use the code you have, if it's Yes or No you'll need to test like this: <?php if ($record['info_box_1'] == 'Yes'): ?> And if you want to see what all the field values are you can always use this: <xmp><?php print_r($record) ?></xmp> Hope that helps! Dave Edis - Senior Developer interactivetools.com
|
|
|  |
|