I have a button that fills in "clock out data" ie time and date and then saves the record. The issue is that with each record the save button number changes...
var d = new Date();
var ctrlDate = Runner.getControl(pageid,'TimeOut');
ctrlDate.setValue(d);
var CD = Runner.getControl(pageid,'TimeIn');
var DO = new Date(CD.getValue());
var DOP = Date.parse(DO)
var dp = Date.parse(d)
var TT =Runner.getControl(pageid,'Totaltime');
var cl = Runner.getControl(pageid,'closed');
// get total seconds between the times
var delta = Math.abs(dp - DOP) / 1000;
// calculate (and subtract) whole days
var days = Math.floor(delta / 86400);
delta -= days 86400;
// calculate (and subtract) whole hours
var hours = Math.floor(delta / 3600) % 24;
delta -= hours 3600;
// calculate (and subtract) whole minutes
var minutes = Math.floor(delta / 60) % 60;
delta -= minutes * 60;
// what's left is seconds
var seconds = delta % 60;
tto =(days)+" day(s) "+(hours)+" hr(s) "+(minutes)+" min "+(seconds)+" sec "
TT.setValue(tto);
cl.setValue(1);
$("#saveButton12").click(); //emulate save button
return false;
When I right click on the "save button" and inspect element, It is differnt number for each record . So if this is normal, how do we emulate the $("#saveButton12").click() in the button code when it changes with each record? I can't find any corresponding record id for the $("#saveButton " ) number..
Thank you.