-
☆ A M B ☆
- 24,524 Posts
I’m having trouble finding documentation on using this event; what parameters does the function require, and how would one go about using Ditto to populate the dynamically added form fields? I’m not afraid of trial-and-error, but I could use a place to start.
As far as I can see from the eform core, it would only take the one parameter, &$fields, so I think the Ditto template would need to output something like "$fields[] = [+whatever+] etc", the trial-and-error part comes in here to find out what would work!
Totally missed this post before....
It depends on what you want to do but if you want to dynamically populate the form the eFormOnBeforeParse event would be a better event as otherwise eForm would be unaware of the added form fields when it processes the form. eFormOnBeforeParse takes to parameters, &$fields and &$templates of which $templates[’tpl’] would be of most interest (but you probably know this already)
How you would go about getting Ditto output in to the event function I’m not sure. I don’t know Ditto all that well. Presumably by calling Ditto from within the eform event function and replacing/adding to the &$templates[’tpl’] variable.
-
☆ A M B ☆
- 24,524 Posts
Thanks! Looks like exactly what I need! In this case, it’s a catalog, and each item will have a checkbox. The order form gets emailed, along with customer’s contact information. Customer is contacted, no online payment gateway.