Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

time stamp

Status
Not open for further replies.

evr72

MIS
Dec 8, 2009
265
US
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?

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;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top