This topic is locked

Calculate hour and minutes and save de result in a field on yhe fly

12/19/2013 6:16:57 AM
ASPRunnerPro General questions
G
georgweber author

I have 3 fields in a add page: Time_start and Time_end and total_time. I would like to calculate how match is the different in Hour and minutes and show the result in the total_time field on the fly.
This is my code on the Javascript on load event, but is dosn´t work
var source1 = Runner.getControl(pageid, 'Time_start');

var source2 = Runner.getControl(pageid, 'Time_end');

var source3 = Runner.getControl(pageid, 'Total_time');
function func() {

source3.setValue(hour(timediff(source2.getValue(), source1.getValue())));

};
source1.on('keyup', func);

source2.on('keyup', func);
any help?