Populate a new list of checkboxes (multi Value) based on the input of another list of checkboxes (Multi Value)

14 posts by 2 authors in: Forums > CMS Builder
Last Post: January 17, 2017   (RSS)

Hi Ross

Thanks for this

I put the code in and changed the red to the correct values, however I am getting an error on the first line of your code:-

Warning: Invalid argument supplied for foreach() in /home/sunsetjavea/public_html/property/listingDetail_test_esp.php on line 299

If I put the :labels option in, it passes line 229 (first line of your code) and I get this error

mysql_get: second argument must be numeric or null, not 'BBQ area'!

This is what I would expect as we are looking for a "num" value here and we are picking up a label.

So what I deduce from this, is the first line of your code is not picking up the num value when I omit the :labels option.

Could you check your first line of code for me please.

Thanks

Andy

By ross - January 16, 2017

Hi Andy

I see the issue. We actually need to use the "values" option in the foreach loop.

<?php foreach ($listing['property_features:values'] as $feature):               // loop through all features ?>
<?php $featureRecord = mysql_get("name of your new features table", $feature);  // load feature record ?>
<?php echo $featureRecord['es_feature'];                                        // display feature in language ?>
<?php endforeach ?>

I marked the change in blue.  

I also marked the original changes in red again.

You may still need to make additional changes to the code.

Thanks!

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

By ross - January 17, 2017

Neat! I'm really glad that worked.

Keep me up to date with how you are making out.

Thanks!

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/