Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Add Stop Watch in Form using LiveCycle Designer

Avatar

Former Community Member
Hi,



How can I add a stop watch into a Form created with Adobe Live Cycle Designer 8.0?



Basically I'd like the following:



I am creating a read-out form for a radiologic study. So the reader should be able to push a button on the very beginning of the form which should trigger a stopwatch to start. At the very end of the form, there should be a 2nd button which the reader can push when he's finished reading and filling out the form to stop the stop watch which was running in the background. The resulting time should then be displayed and saved in a field for export to Excel later on. Is this possible using JavaScript?



If this doesn't work, alternatively there could be a button to push in the beginning of the form which would put the actual Date/Time in a Field and at the bottom of the Form a second button which would again show the actual date/time in a field. This way I would export the two fields into Excel and then let Excel calculate the needed time to fill out the form.

When I add a Date/Time Field, it updates, whenever someone makes a change to the form.



Thank you for your help,



Olivio Donati
2 Replies

Avatar

Former Community Member
There is no stop watch per se.... but your technique of getting the time should work here. On the click event of the Start button you will need to record the time in a hidden field (so you can get at it later). On the Finish button you can record the time again and then get the difference between the stop and start time. FormCalc has some built in functions that will change a given time to the number of milliseconds that have elapsed from a specific epoch. You will need this to do the time calc.

Avatar

Former Community Member
Thank you very much for the quick answer.



It worked by adding two buttons, one that you click when starting the exam and another when you're done. It's not very elegant but efficient ;-)



Button1: FormTime.value = Time();

Button2: TotalTime.rawValue = (Time() - FormTime) / 1000.0 / 60.0;



Thank you,



Olivio