Hi,
the answer will most certainly be around somewhere, but I couldn't find it sofar.
One of my form variables denotes a number and in the Thankyou message I would like to use this number and present the result to the user. In former days I wrote something like:
This no longer works in ChronoForms5/Joomla 3.6.2/PHP7.
How should I do this nowadays?
Regards,
Peter
the answer will most certainly be around somewhere, but I couldn't find it sofar.
One of my form variables denotes a number and in the Thankyou message I would like to use this number and present the result to the user. In former days I wrote something like:
Please pay us
<?php
$count = Jrequest::getVar(‘number’,‘’, ‘post’);
$total = $count * 12.5;
echo ‘€ ’, number_format($total, 2);
?>
for your order.
This no longer works in ChronoForms5/Joomla 3.6.2/PHP7.
How should I do this nowadays?
Regards,
Peter
Additionally to the above:
I tried
according to documentation found, but here the ">" in "$form->data" is apparently interpreted as closure of the "<?php" fragment, although there is no question mark present.
A bug?
Regards
Peter
I tried
<?php
$count = $form -> data['number'];
$total = $count * 12.5;
echo ' € ', number_format($total, 2);
?>
according to documentation found, but here the ">" in "$form->data" is apparently interpreted as closure of the "<?php" fragment, although there is no question mark present.
A bug?
Regards
Peter
Hi peter49,
No I don't think so, maybe some typos. Please remove the spaces round - >
Bob
No I don't think so, maybe some typos. Please remove the spaces round - >
<?php
$count = $form->data['number'];
$total = $count * 12.5;
$total = number_format($total, 2);
echo ' € '.$total;
?>
Bob
Hi Bob,
thank you for answering, but too bad!
When the Thanks Message Content:is
then after enhtering 3 as 'reserv_aantal' quantity the actual thanks message is:
This happens both when using Internet Explorer and Firefox. Any more ideas?
By the way, I still use the simple setup mode.
Regards,
Peter
thank you for answering, but too bad!
When the Thanks Message Content:is
Maakt u s.v.p.
<?php
$aantal = $form->data['reserv_aantal'];
$totaal = $aantal * 12.5;
echo ' € '.$totaal;
?>
(= {reserv_aantal} x €12,50) over
then after enhtering 3 as 'reserv_aantal' quantity the actual thanks message is:
Maakt u s.v.p. data['reserv_aantal']; $totaal = $aantal * 12.5; echo ' € '.$totaal; ?> (= 3 x €12,50) over
This happens both when using Internet Explorer and Firefox. Any more ideas?
By the way, I still use the simple setup mode.
Regards,
Peter
Hi peter49,
Sorry, I missed an important bit - you can't use PHP in a Thank you message action (I think that is because it has the WYSIWYG editor option). Please use the same code in a Custom Code action instead - that does support PHP.
Bob
Sorry, I missed an important bit - you can't use PHP in a Thank you message action (I think that is because it has the WYSIWYG editor option). Please use the same code in a Custom Code action instead - that does support PHP.
Bob
This topic is locked and no more replies can be posted.