Javascript OnLoad Event: code is below.
var ctrlStudent = Runner.getControl(pageid,'StudentID');
var ctrlRate = Runner.getControl(pageid,'Rate');
ctrlRate.makeReadonly();
var ctrlQTY = Runner.getControl(pageid,'QTY');
var ctrlAmount = Runner.getControl(pageid,'Amount');
function funcAmount(){
ctrlAmount.setValue((+ctrlRate.getValue())*(+ctrlQTY.getValue()));
};
ctrlStudent.on('change', funcAmount);
ctrlQTY.on('keyup', funcAmount);
When Dropdown StudentID is selected. It gives Amount (Total) of Rate and QTY.
There is no error in the code and even code is working fine.
But weird thing is, when I select StudentID the result produced is 1 step behind.
With first click nothing happens.
2nd click gives result of 1st click.
3rd click gives result of 2n click.
and so on...
Result means> ctrlStudent.on('change', funcAmount);
Any help would be appreciated. Thanks