I have a form where one of the fields is a bunch of checkboxes. The problem is, the number of these checkboxes will vary over time (it’s a bunch of categories and I might add to the list from time to time).
In the form, these checkboxes are created using a snippet call. This snippet extracts the category names from a database. I could have the snippet give the checkbox fields names like ’cat1’, ’cat2’ etc. I can write the report chunk so that it has entries like:
[+cat1+]
[+cat2+]
... etc
This means manually editing the report chunk whenever I add a new category to the database table.
So, can I use another snippet and place a call to it within the report chunk?
-
☆ A M B ☆
- 24,524 Posts
No. The report chunk is never passed through the MODx parser; it is taken and directly processed by eForm, replacing the placeholders in the chunk with values from eForm’s $fields array.
The way to do what you need is to use a custom snippet attached to an appropriate eForm event (in this case, "eFormOnBeforeMailSent"), modifying the $fields array. This will make the values available as placeholders to use in the report chunk.
See the documentation that comes with eForm for further information on using eForm events.
Okay - I got that working fine - thanks.