Hello,
I have a JavaScript program that gets data from a table, I am trying to add two fields and then write to a third field.
Scenario,
first field "timein" static field this field has data
second field "timeout" dynamic field the time will be written when the save button is pressed
third field "tottime" this field is ("timeout" - "timein")/100
all this works well, the problem that I have is that I want to make all my fields read only so the user cannot change the time
the script that I have has
This code works well but only if the I make the "totem" not read only so the user can click on it and then it will calculate.
I need it to calculate when the page loads, I have tired 'load', 'mouseover', etc and none of these work.
Any help is much appreciated.
thanks!!!!
I have a JavaScript program that gets data from a table, I am trying to add two fields and then write to a third field.
Scenario,
first field "timein" static field this field has data
second field "timeout" dynamic field the time will be written when the save button is pressed
third field "tottime" this field is ("timeout" - "timein")/100
all this works well, the problem that I have is that I want to make all my fields read only so the user cannot change the time
the script that I have has
JavaScript:
var ctrltimein = Runner.getControl(pageid, 'TIMOUT');
var ctrltimeout = Runner.getControl(pageid, 'TIMEIN');
var ctrlTotal = Runner.getControl(pageid, 'TOTTIM');
function func() {
ctrlTotal.setValue(Number((ctrltimeout.getValue()) - Number(ctrltimein.getValue()))/100);
};
ctrlTotal.on('keyup', func);
This code works well but only if the I make the "totem" not read only so the user can click on it and then it will calculate.
I need it to calculate when the page loads, I have tired 'load', 'mouseover', etc and none of these work.
Any help is much appreciated.
thanks!!!!