I have a form that calculates a travel deposit based on the number of individuals being registered. It uses this code on the "On Submit" action to make the calculation and store it to a hidden field on the form named 'dep_amt':
When I add an "echo" to display the value of the deposit, it shows the correct amount. However, when I go to pass it off to PayPal, the amount shown does not match, varying between $400 - $1000. Any idea why???
It's SO weird!
Thanks!
Rick
<?php
$form->data['dep_amt'] = 0;
$first = $form->data['first_fname'];
$second = $form->data['second_fname'];
$third = $form->data['third_fname'];
$fourth = $form->data['fourth_fname'];
if ($first) {$number = 1;};
if ($second) {$number = $number + 1;};
if ($third) {$number = $number + 1;};
if ($fourth) {$number = $number + 1;};
$deps_amt = 100;
$deposit = $deps_amt * $number;
$form->data['dep_amt'] = $deposit;
?>
When I add an "echo" to display the value of the deposit, it shows the correct amount. However, when I go to pass it off to PayPal, the amount shown does not match, varying between $400 - $1000. Any idea why???
It's SO weird!
Thanks!
Rick