Hello,
I wrote a script to insert the current time on a field depending on another field
for example if my field "start" = "Now" then my field "pick_start_time" should get the current time
what my script is doing when "start" = "Now" I get redirected to a blank page with the time on it
not sure how to get the time on my "pick_start_time" field
here is what I have so far
I wrote a script to insert the current time on a field depending on another field
for example if my field "start" = "Now" then my field "pick_start_time" should get the current time
what my script is doing when "start" = "Now" I get redirected to a blank page with the time on it
not sure how to get the time on my "pick_start_time" field
here is what I have so far
Code:
var tName = 'pick';
var ctrlkeycontrol = Runner.getControl(pageid, 'start');
var ctrlkeycontrol02 = Runner.getControl(pageid, 'stop');
var ctrlresp = Runner.getControl(pageid, 'pick_start_time');
var ctrlresp02 = Runner.getControl(pageid, 'pick_finish_time');
function func() {
var currentTime = new Date()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()
if (minutes < 10){
minutes = "0" + minutes
}
document.write(hours + ":" + minutes + " ")
if(hours > 11){
document.write("PM")
} else {
document.write("AM")
}
};
if (ctrlkeycontrol.getValue() == 'Now')
ctrlkeycontrol('==', func);