[SOLVED] Formbuilder: how to display check box group options

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
stevew
Forum Members
Forum Members
Posts: 74
Joined: Wed May 21, 2008 7:02 am

[SOLVED] Formbuilder: how to display check box group options

Post by stevew »

CMS 1.9.4.1
Formbuilder 0.7

Hi,
I have a form with a check box group (ID = meetings). I want to have the checked options in the check box group displayed in list format on the page the user sees after form submission, and also in the emails to the user and to me.

I thought I could use

Code: Select all

{foreach from=$meetings item=meeting}<li>{$meeting}</li>{/foreach}
But the checked options just come out in a string, with commas. Using $meetings|print_r gives the same result.

I've tried using the IDs from the HTML source (meetings_0, meetings_1, etc.), but no luck.

Please, someone tell me what I'm doing wrong!
TIA

SOLVED:

Code: Select all

<ul>{assign var='meetings' value=","|explode:$meetings}
{foreach from=$meetings item='meeting'}
<li>{$meeting}</li>
{/foreach}</ul>
NOTE:
This works in the Submission template, but not in the email templates. A workaround is to forget the list and just insert a line break <br /> at the beginning of the "Value when checked" field for each item in the check box group. I imagine there's a better way, though. ;-)
Post Reply

Return to “Modules/Add-Ons”