I am attempting to do two calculations on my add page with Javascript onload Event. I am only able to get one value to populate.
I have searched the forum without luck. Any help is greatly appreciated!
Thanks
Hopper
var ctrlPrice = Runner.getControl(pageid, 'merchant_rate');
var ctrlQuantity = Runner.getControl(pageid, 'total_minutes');
var ctrlTotal = Runner.getControl(pageid, 'total_invoiced');
function func() {
ctrlTotal.setValue(Number(ctrlPrice.getValue()) * Number(ctrlQuantity.getValue()));
};
ctrlPrice.on('keyup', func);
ctrlQuantity.on('keyup', func);
var ctrlPrice1 = Runner.getControl(pageid, 'partner_rate');
var ctrlQuantity1 = Runner.getControl(pageid, 'total_minutes');
var ctrlTotal1 = Runner.getControl(pageid, 'total_cost');
function func() {
ctrlTotal1.setValue(Number(ctrlPrice1.getValue()) * Number(ctrlQuantity1.getValue()));
};
ctrlPrice1.on('keyup', func);
ctrlQuantity1.on('keyup', func);
I have searched the forum without luck. Any help is greatly appreciated!
Thanks
Hopper
var ctrlPrice = Runner.getControl(pageid, 'merchant_rate');
var ctrlQuantity = Runner.getControl(pageid, 'total_minutes');
var ctrlTotal = Runner.getControl(pageid, 'total_invoiced');
function func() {
ctrlTotal.setValue(Number(ctrlPrice.getValue()) * Number(ctrlQuantity.getValue()));
};
ctrlPrice.on('keyup', func);
ctrlQuantity.on('keyup', func);
var ctrlPrice1 = Runner.getControl(pageid, 'partner_rate');
var ctrlQuantity1 = Runner.getControl(pageid, 'total_minutes');
var ctrlTotal1 = Runner.getControl(pageid, 'total_cost');
function func() {
ctrlTotal1.setValue(Number(ctrlPrice1.getValue()) * Number(ctrlQuantity1.getValue()));
};
ctrlPrice1.on('keyup', func);
ctrlQuantity1.on('keyup', func);