This topic is locked
[SOLVED]

 Getting On Load events to fire/work

5/15/2016 6:59:48 AM
ASPRunnerPro General questions
Q
Quintin author

My OnLoad code to an Add form is:-
var ctrlPrice=Runner.getControl(pageid, 'price');

var ctrlUnits=Runner.getControl(pageid, 'qty');

var ctrlTotal=Runner.getcontrol(pageid,'total');
function func() {

ctrlTotal.setValue(parsefloat(ctrlPrice.getValue()3))

};

ctrlPrice.on('change',func);

ctrlPrice.on('keyup',func);
ctrlPrice.on('click',func);
I really want total=qty
price but when it didn't work I decide a very simple "multiply unit price by 3 and put into total" just to test event firing.
But nothing happens. Nothing fires and Total doesn't change. I tried to follow the Video example of Javasript API. I also have another application where I have written code that fires.
Any ideas?

Q
Quintin author 5/15/2016

Ignore me!
I simplified using the example in the Help "How to calculate values on the fly". I copied it and substituted my actual field names and it works. I've go no idea why my original code didn't work.