Forums

PHP return value not displaying in field

Roaf 23 Jan, 2018
Hello, I have the following bit of php code:

$res_amount =& $form->data['res_amount'];
$time_res =& $form->data['time_amount'];
$total_price = 0;


$total_price = $res_amount + $time_res;

return $total_price;


When I debug, the return and var are both set to the correct amount, like 12.98, but the field its supposed to go to appears empty still.

I have a 'total' field reloaded on a "price" event upon choosing a reservation time. The total field has value of {var:php15} which happens to be php code.

Any ideas?
Max_admin 25 Jan, 2018
Hi Roaf,

The PHP action should be ABOVE the "Display section" action, is it ?

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Roaf 29 Jan, 2018
Answer
1 Likes
Wrong syntax on my end. I figured it out.

Thanks for the reply!
This topic is locked and no more replies can be posted.