Hello,
I am building a log in and out to track the time each employee spends on a specific job.
I can capture their time in and time out with no issues, but to calculate the total time is where I am a bit confused.
my script is very simple, I simply to capture the time in the employee scans his/her id this triggers the save button and the time gets saved in a field called "TIMEIN" this also redirects to the logout page, allt the data is passed from one page to the other. in there I capture the log out time the same was as the log in time if I were to leave it just like this I would get the log in and out in the database fields.
but when I try this does not work because the page would need to refresh, is there a way that I can add my "Timein" plus the current time, just hours and minutes?
I am building a log in and out to track the time each employee spends on a specific job.
I can capture their time in and time out with no issues, but to calculate the total time is where I am a bit confused.
my script is very simple, I simply to capture the time in the employee scans his/her id this triggers the save button and the time gets saved in a field called "TIMEIN" this also redirects to the logout page, allt the data is passed from one page to the other. in there I capture the log out time the same was as the log in time if I were to leave it just like this I would get the log in and out in the database fields.
but when I try this does not work because the page would need to refresh, is there a way that I can add my "Timein" plus the current time, just hours and minutes?
Code:
var ctrlPrice = Runner.getControl(pageid, 'TIMOUT');
var ctrlQuantity = Runner.getControl(pageid, 'TIMEIN');
var ctrlTotal = Runner.getControl(pageid, 'TOTTIM');
function func() {
ctrlTotal.setValue(Number((ctrlPrice.getValue()) - Number(ctrlQuantity.getValue()))/100);
};
window.onload = func;