Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Time Formats

Avatar

Not applicable
I would like to have the caption of a checkbox change from the text to the time that the box was checked.(Basically Time Stamp the Click Event) I've been able to get it to change to the milliseconds but have not been able to format this number to readable time.



The code that I'm using is this:



CheckBox1.caption.value.#text = Time()



I have tried to use the Num2Time function but all I get are error messages. I would appreciate any help that can be given.



Thanks
2 Replies

Avatar

Not applicable
In the check box's Click event, you can use the following script (make sure the language is set to
JavaScript😞



var oNow = new Date;

//this.caption.value.resolveNode("#text").value = oNow.toTimeString();

this.caption.value.resolveNode("#text").value = (oNow.getMonth() + 1) + "/" + oNow.getDate() + "/" + oNow.getFullYear() + " @ " + oNow.getHours() + ":" + oNow.getMinutes() + ":" + oNow.getSeconds();


The first method is commented-out in this example. Try it the way it is and then try commenting the third line and un-commenting the second one to see the difference.



Stefan

Adobe Systems

Avatar

Level 1

Is there a way to adapt that script to make a check box's background color change when the box is checked, i.e, white before being checked and grey after checked?