data['total'] = $total; - but I cannot recall this data inside of e-mail ; it doesn't work if I am using a php call or the curly bracelet{total}data['total'];?>both doesn't work.I think the error could be in sequence I set in "Events" but I cannot get where. Thanks if you can see how to point me my error (and sorry for my poor english).Antoine.Edit --> I solved 😀 it by adding a "Custom code" element (set on "controller" mode) as a first event in the on Submit (see picture below), so the datas from form will be collected, extended calculations will be done THEN datas are send to the session and later can be called back.[attachment=0]chrono2.JPG[/attachment]"> adding datas to the form array, and passing them - Forums

Forums

adding datas to the form array, and passing them

agaudin 18 Jun, 2011
Hi Chronoengine team,

and before anything else, thanks alot for your amazing work and your nice comments on forum.
I have pain to learn how to use ChF V4, but step by step I get it, except this one : I need to add php results to the form datas and passing both to e-mail.
As red here :
- I am using Data to session / Session to data events around the onsubmit (see picture) and it works, datas are send to e-mails
[attachment=1]chrono.JPG[/attachment]
- Inside the "confirmation page" I am using the code below to add the php data into the form array ; I tested qith an echo and the data is in the array
$form->data['total'] = $total;

- but I cannot recall this data inside of e-mail ; it doesn't work if I am using a php call or the curly bracelet

{total}
<?php echo $form->data['total'];?>

both doesn't work.

I think the error could be in sequence I set in "Events" but I cannot get where. Thanks if you can see how to point me my error (and sorry for my poor english).

Antoine.


Edit --> I solved 😀 it by adding a "Custom code" element (set on "controller" mode) as a first event in the on Submit (see picture below), so the datas from form will be collected, extended calculations will be done THEN datas are send to the session and later can be called back.
[attachment=0]chrono2.JPG[/attachment]
agaudin 20 Jun, 2011
The solution above is leading me to a surprising second problem :
in the custom code I can get values from the form by using both methods below
$form->data['test'] = $_POST['xxx'];
$form->data['test'] = $form->data['xxx'];

I can add other datas like time by using the array in php :
$form->data['date']= date("d/m/Y");
$form->data['heure'] = date("H:i");


In the confirmation page, everything is fine and I can recall all my created values by using the curly bracelet or a php call
[code]{xxx}
or
<?php echo
$form->data['xxx'];?> 

It works.

But, after the OnConfirm / Session to data, the datas I added by custom code seem to be lost (but NOT the 'time' and 'date' I set with php at the same time that the datas I calculated). Date and time can be recalled in e-mail, but not others values.

I cannot get it ! Any idea ?
Max_admin 20 Jun, 2011
Hi agaudin,

Any variables in the form data array can be called, you can use this code in a custom code box to see what's the data inside the array at any step during the execution:


<?php print_r2($form->data); ?>


See if your test variable is there ?

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.