i have two variables quantity and amount. i need to compute the quantity 8 x amount. and where do i put the calculation?
Forums
How to Compute product of two varibles
Hi dariegler,
It depends where you want the calculation to display. If you want an immediate result you'd use JavaScript in a Load JS action in the On Load event of your form.
If you want to calculate only after the form is submitted use PHP In a Custom Code action in the On Submit event of your form.
Note that even if you use JavaScript for an immediate result you should re-check the calculation with PHP after the form is submitted.
Bob
It depends where you want the calculation to display. If you want an immediate result you'd use JavaScript in a Load JS action in the On Load event of your form.
If you want to calculate only after the form is submitted use PHP In a Custom Code action in the On Submit event of your form.
Note that even if you use JavaScript for an immediate result you should re-check the calculation with PHP after the form is submitted.
Bob
thanks, that is what i thought from reading the faq's. I am not a php coder so what would the code be in custom code? or java script?
dave
dave
Hi dariegler,
You'll find many examples in the forums here or by Googling around.
If you put the input names and the calculation specification here then we may be able to write some code for you if time allows.
Bob
You'll find many examples in the forums here or by Googling around.
If you put the input names and the calculation specification here then we may be able to write some code for you if time allows.
Bob
the names are [amt] and [number] and i want to multipliy them to produce [cost]
Hi dariegler,
The PHP version would be
Bob
The PHP version would be
<?php
$form->data['cost'] = $form->data['amt'] * $form->data['number'];
?>
Bob
This topic is locked and no more replies can be posted.