Problem passing an array of check boxes to a record using $addLink and an email template (Solved)

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 10, 2019   (RSS)

Problem passing an array of check boxes to a record using $addLink and an email template

By daniel - April 10, 2019

Hi Jerry,

When using multiple checkboxes like that, it will return an array of selected results - rather than a string - so it takes a different method to process. Try adding this code after the block of $addLink assignments:

if (!empty( $_REQUEST['fieldname'] )) {
  foreach ($_REQUEST['fieldname'] as $value) {
    $addLink .= '&fieldname[]=' . urlencode($value);
  }
}

You'll need to replace "fieldname" with the name of the checkbox field you're using.

Let me know if that does the trick!

Thanks,

Daniel
Technical Lead
interactivetools.com

Problem passing an array of check boxes to a record using $addLink and an email template

By gkornbluth - April 10, 2019

Hi Daniel,

Worked like a charm.

Of course it's only easy when you know what you're doing.

Have a good evening.

I updated the code above to reflect the changes.

Thanks as always,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php