How to Create Start and Stop Time Fields in Adobe Acrobat Forms
Question details
The user needs to stop the start-time and stop-time fields from mirroring each other and wants to automatically calculate the elapsed time between the two.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating an interactive student assessment PDF form that requires recording entry and exit timestamps.
- Observed behavior
- The stop-time field automatically receives the exact same value as the start-time field when data is entered, preventing independent timestamping and accurate elapsed time calculation.
Ensure you are using a PDF editor with advanced form-creation capabilities and that JavaScript execution is enabled in your PDF viewer preferences to allow time calculations.
Assign Unique Field Names and Use Custom JavaScript
PDF fields with identical names will automatically mirror data. Renaming the fields and utilizing JavaScript for the timestamps will resolve the duplication and enable the elapsed time calculation.
In Adobe Acrobat, any form fields that share the exact same 'Name' property are linked together by default. Modifying one will instantly update the other. To record distinct events like start and stop times, each field must have a unique identifier.
Enter 'Prepare Form' mode in Acrobat. Right-click the start-time field, select 'Properties', and name it 'StartTime'. Do the same for the stop-time field, naming it 'StopTime'.
Create two interactive buttons (e.g., 'Start Assessment' and 'End Assessment'). In the Button Properties under the 'Actions' tab, select 'Run a JavaScript' as the action.
For the start button script, use code like 'this.getField("StartTime").value = util.printd("mm/dd/yyyy HH:MM:ss", new Date());'. Apply the corresponding script for the StopTime field on the second button.
Create a third text field named 'ElapsedTime'. In its Properties, go to the 'Calculate' tab, select 'Custom calculation script', and write JavaScript to parse the StartTime and StopTime values, subtract them, and format the output into hours and minutes.

Edit and Manage PDF Forms Easily with WPS Office
WPS Office provides a comprehensive PDF toolset that allows you to effortlessly create, edit, fill, and manage interactive PDF forms without the complexity of heavy, expensive software.
- 1. Open your PDF: Launch WPS Office and open the PDF form you wish to modify or fill.
- 2. Access the Form tools: Navigate to the 'Form' tab located in the top ribbon menu to access all interactive elements.
- 3. Edit field properties: Double-click any text field or right-click and select 'Properties' to ensure unique field names, avoiding duplicate data entries.
- 4. Save and distribute: Once your form is perfectly adjusted, save the document and easily share it for seamless data collection.

Frequently Asked Questions
Why do multiple fields in my PDF form fill with the same data?
This occurs when text fields are copied and pasted or created with the exact same field name. Acrobat inherently links fields with identical names to save time when entering repeated data (like a user's name on multiple pages). To fix this, open the field properties and give each field a unique name.
How do I format a text field to display elapsed time?
In the field properties menu, navigate to the 'Format' tab. Select 'Custom' from the format category, and input a custom keystroke script that formats the calculated output into your preferred layout, such as hours and minutes (e.g., HH:MM).
Will JavaScript calculations work on mobile PDF readers?
Not reliably. Many mobile PDF viewers or built-in browser plugins have limited or no support for JavaScript execution. It is highly recommended to advise users to complete interactive forms in a fully featured desktop reader like WPS PDF or Acrobat Reader.




