Hi,
I have this code for calculation on the fly(in a JavaScript OnLoad event) but for some reason the balanceand totalAmountthat is being sent to the database is 0 all the time. The calculations itself works fine and provides the correct results on the screen but 0 is stored in the database.
var ctrlTransferAmount=Runner.getControl(pageid,'transferAmount');
var ctrlTransferRate=Runner.getControl(pageid,'transferCharge');
var ctrlCommission=Runner.getControl(pageid,'commission');
var ctrltotalAmount=Runner.getControl(pageid,'totalAmount');
var ctrlBalance=Runner.getControl(pageid,'balance');
function func()
{
ctrltotalAmount.setValue(parseFloat(ctrlTransferAmount.getValue())*parseFloat(ctrlTransferRate.getValue())+parseFloat(ctrlCommission.getValue()));
ctrlBalance.setValue(parseFloat(ctrlTransferAmount.getValue())*parseFloat(ctrlTransferRate.getValue()));
ctrlBalance.setDisabled();
ctrltotalAmount.setDisabled();
};
ctrlTransferAmount.on('keyup',func);
ctrlTransferRate.on('keyup',func);
ctrlCommission.on('keyup',func);
I have also have this code to set the values of the balance and totalAmount in the Before record Added event and still getting 0 stored in the database.
$values["totalAmount"]=($values["transferAmount"] * $values["transferRate"] )+ $values["commission"];
$values["balance"]=($values["transferAmount"] * $values["transferRate"] );
How can I make sure the result that I see on the screen goes into the database as well.
Thx....