Checkbox value
2 posts by 2 authors in: Forums > CMS Builder
Last Post: July 23, 2012 (RSS)
By Kittybiccy - July 23, 2012
Hi guys,
I have set up a checkbox so that when a product is sold, the user simply clicks the checkbox. I want this to then display the words 'sold' under the product but also, when unchecked, to not appear at all. Could you please tell me what code I need to include/change to do this? Thanks!
Hannah
I have set up a checkbox so that when a product is sold, the user simply clicks the checkbox. I want this to then display the words 'sold' under the product but also, when unchecked, to not appear at all. Could you please tell me what code I need to include/change to do this? Thanks!
Hannah
Re: [Kittybiccy] Checkbox value
By Jason - July 23, 2012
Hi Hannah,
You can do this with a simple if statement.
For example, if the name of your checkbox field is "sold", you can use this:
EXAMPLE:
Hope this helps
You can do this with a simple if statement.
For example, if the name of your checkbox field is "sold", you can use this:
EXAMPLE:
<?php if ($record['sold']):?>
Sold!
<?php endif ?>
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/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/