IF 2 checkboxes in the same field are checked

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

Re: [benedict] IF 2 checkboxes in the same field are checked

By Dave - December 17, 2008

Hi Benedict,

Are there 2 checkbox fields with different names or is it a multi-value list field displaying as checkboxes?

It's a little trickier with a multi value field because it stores both values together sepearted by tabs. Try this code:

<?php if (preg_match("/Post Secondary Courses/", $hospitalityRecord['course_type']) &&
preg_match("/International Student Courses/", $hospitalityRecord['course_type'])): ?>

This course is available to both Local &amp; International Students

<?php else: ?>
<?php echo $hospitalityRecord['course_type'] ?>
<?php endif ?>


Let me know if that works for you! :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] IF 2 checkboxes in the same field are checked

Works perfectly. Thanks, mate - you're the man.