Forums: [SOLVED] Getting On Load events to fire/work - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

[SOLVED] Getting On Load events to fire/work My OnLoad's won't fire Rate Topic: -----

#1 User is offline   Quintin 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 16-June 11

Posted 15 May 2016 - 10:59 AM

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?
0

#2 User is offline   Quintin 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 16-June 11

Posted 15 May 2016 - 11:17 AM

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.
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked