Hello,
I need to calculate the interest of a payment depending of the amountPay
and the interestType
fields that the user completes on a form. When the user hits submit I need to insert in the interest
field lets say amountPay * 0.05
.
The problem is that as interest
is a function field
and it searches for the value of the current amountPay
and interestType
records it fails because they haven't been saved yet. If after saving I edit the field and save it again then I get the correct interest.
Is there any way I can do this on the fly just by hitting submit 1 time?
Any tip in the right direction will be much appreciated, thanks!
You should take a look at on_change function.