How to Add a Time Limit to a Fillable PDF Form
Question details
A teacher wants to know if a fillable PDF assessment can be configured to automatically lock or expire exactly one hour after a student opens it remotely.

- Product
- Device & OS
- not provided
- Scenario
- Creating a remote PDF assessment where students are given a strict time constraint to complete the document.
- Observed behavior
- Needs a mechanism to enforce a strict one-hour completion time limit on a standalone fillable PDF file.
Before attempting to add a time limit to a local PDF file, consider that standalone PDFs are inherently difficult to secure against tampering if the user has full control of their own device.
Use JavaScript to Lock Fields After a Specified Time
You can embed custom document-level JavaScript in advanced PDF editors to record the opening time and lock form fields after 60 minutes.
While the PDF format does not have a native 'self-destruct' timer, you can add custom JavaScript to track elapsed time. When the document is opened, the script records the start time, and a countdown script periodically checks the elapsed time. Once the one-hour mark is reached, the script changes all fillable fields to 'read-only'.
However, this method is fundamentally insecure. Students can easily bypass it by disabling JavaScript in their PDF reader, using a basic PDF viewer that doesn't support scripts, or changing their computer's system clock.
Open your fillable PDF form in an advanced PDF editor that supports document-level JavaScript authoring.
Navigate to the JavaScript or Form settings and create a new Document Action triggered when the file is opened.
Insert a custom script that captures the current time using 'new Date()' and sets a timeout (using 'app.setTimeOut') to loop through all form fields and set their 'readonly' property to true after 3600000 milliseconds.
Save the PDF and send it to your students. You must explicitly advise them to use a compatible PDF reader with JavaScript enabled, otherwise the timer will not function.

Use a Learning Management System (LMS) or Secure Testing Platform
For reliable, tamper-proof timed assessments, migrate your PDF content to a dedicated online assessment tool instead of relying on a standalone file.
Create and Manage Fillable PDFs with WPS Office
WPS Office provides a comprehensive PDF toolkit to easily create, edit, and manage PDF forms. While high-stakes timed exams are best handled by dedicated online platforms, WPS Office is perfect for designing the assessment layouts, managing form fields, and converting your existing documents.
- 1. Open your Document: Launch WPS Office and open your existing PDF or a blank document to start designing your assessment.
- 2. Access Form Tools: Navigate to the 'Form' tab in the top ribbon to access various fillable field options.
- 3. Insert Form Fields: Click to add text fields, check boxes, or radio buttons where students need to input their answers.
- 4. Save as PDF: Once your assessment layout is complete, save the file as a PDF document ready for distribution.

Frequently Asked Questions
Can I password-protect a PDF to expire after a certain calendar date?
Yes, advanced PDF DRM (Digital Rights Management) tools can set a document to expire on a specific calendar date. However, setting a countdown timer that starts exactly from the moment of opening requires custom JavaScript or specialized DRM software.
Will a JavaScript time limit work on mobile PDF readers?
Often, no. Many mobile PDF viewers, default web browser PDF plugins, and basic reader apps do not support advanced JavaScript or form scripts. If a student uses one of these, the timer script will simply not execute, and the fields will never lock.
How can I prevent students from copying or editing the PDF assessment?
You can use PDF editing software to set permission passwords, restricting unauthorized copying, printing, and editing. However, for remote testing scenarios, dedicated testing platforms always offer much better security against cheating than a standalone file.




