Hey Guys,
Joomla v1.5
ChronoForms v3
My form has table of fields going horizontal with (add) button. What the add button does is clone the element and gives it new id's.
When the form is submitted I get the dynamic / cloned elements in my $_POST variable, but when the confirmation email is sent to the email defined I do not get those additional fields created. It seems the only values going through are the ones created by the form in the wizard, or fields that already exist when the page is loaded, anyway to add them to the array of values that are used when sending the email?
Hi NeedsHelp,
You'd need to have all the 'extra' names in the Email template; or more tidily to use PHP to check the submitted results and add the extra lines to the template as needed.
Bob
How could I check the php code before it is sent, I mean I know it would be code needed in the before sent but what type?
Hi NeedsHelp,
It depends a bit on how you have the 'extendable' inputs setup but basically I'd look at the $_POST array to see which inputs were included there.
Bob
I'm following I guess what I am wondering is how do I get the new post items into the already set post that chrono's is waiting for?
Because if I submit this code after "send email" section I can get the dynamic element values, but how do I inject them in to the $post that chrono is using?
Hi NeedsHelp,
You've lost me?
Are you talking about the 'fixed template' method - in that case you need to include all possible names in the template.
Or the 'variable' template method - in that case you'd build the template with PHP depending on the form results.
Bob
A mixture basically this is what's happening.
I have an input that is being cloned (my dynamic element), when you submit, Chrono form can not see that value, or add it to the email template, but you can access it after being submitted in the get::('post') or $_POST.
Hi NeedsHelp,
Yes I understand, but that isn't the question I'm asking. ChronoForms will see it OK. The question is how you want to include the results in the Email template??
Bob
We are definitely on the same page. I would love for it to be dynamic into the email template, because the cloned elements depends on how many time the user submits it. The user may add or subtract the number of cloned elements, each of course with unique name, and id, so I can't have anything set.
Hi needshelp,
OK, then the trick is to make a part of the Email template dynamic. Turn off the HTML editor in the Email setup properties box then put a PHP section into the Email template. What are the names of your dynamic inputs?
Bob
They get dynamically name so for example;
name-0, name-1 etc..