simple if statement

7 posts by 2 authors in: Forums > CMS Builder
Last Post: May 3, 2016   (RSS)

By thenetgirl - May 2, 2016

I am so not getting this  values verses lables thing  ..dont explain  ..you have tried

I need help with a simple if then statement

Application (values): <?php echo join(', ', $rentalsRecord['application:values']); ?><br/>
Application (labels): <?php echo join(', ', $rentalsRecord['application:labels']); ?><br/>

Yes or 1 values or lables I have tried them all

Basically  I need it to display an application if the box checked says Yes and it will be 99% of the time

<?php if ($rentalsRecord['application:values'] == 'Yes'): ?>

        DOWNLOAD APPLICATION
    
    <?php endif; ?>

This is so simple what am I missing???

Patricia

www.thenetgirl.com

By gregThomas - May 3, 2016

Hi thenetgirl,

Is this for a list field? If so, could you send me the options that you're using (see attached image). and is it a multi or single option one?

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com
Attachments:

list options.png 42K

By thenetgirl - May 3, 2016

Here you go

Patricia

www.thenetgirl.com
Attachments:

list.jpg 169K

By gregThomas - May 3, 2016

Thanks! I notice that you're using a multi option pull down so that a record can have both Yes and No as options at the same time. If you change the display as option to pull down (see attached image), then you can use the following code to display the record where application is Yes:

<?php if ($rentalsRecord['application'] == 'Yes'): ?>

Let me know if you have any questions.

Cheers,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By thenetgirl - May 3, 2016

no image attached :-)

Patricia

www.thenetgirl.com

By thenetgirl - May 3, 2016

Yippie awesome ....you are the BEST!  THANK YOU!!!!

Patricia

www.thenetgirl.com