Checkbox

3 posts by 2 authors in: Forums > CMS Builder
Last Post: March 24, 2010   (RSS)

By northernpenguin - March 24, 2010

Hi

I have a checkbox field in one of my section editors. How do I display the value of the checkbox as "yes" or "no" vice "0" or "1"? Its probably very simple, but I'm not seeing it!
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

Re: [northernpenguin] Checkbox

By Jason - March 24, 2010

Hi,

You can use this code here:

<?php echo $record['mycheck'] ? "Yes" : "No"; ?>

Where $record is your set of records and 'mycheck' is the name of your checkbox field. This will print out "yes" if the checkbox = 1 and "no" if the checkbox=0.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Checkbox

By northernpenguin - March 24, 2010

Thanx Jason!

It worked!!
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke