How to Require a Second PDF Signature Based on Form Field Values
Question details
Configure a PDF form to dynamically require an additional signature if a calculated total in another field exceeds a specified value.

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Creating dynamic PDF forms, such as expense reports or purchase orders, that require secondary approval or signatures only for high-value totals.
- Observed behavior
- The form dynamically evaluates the total amount entered, triggers a warning alert, and sets a second signature field to a 'required' state if the threshold is met.
Verify that your PDF editor supports JavaScript for interactive form fields, and ensure you have already created the calculation field (e.g., Total) and the secondary signature field (e.g., Signature2).
Add a Custom Validation Script to the Total Field
Apply JavaScript to the total field to evaluate the input and dynamically change the required status of the second signature field.
By using a custom validation script, the PDF can actively monitor the total value. If the value crosses your defined threshold (e.g., 1000), the script prompts the user with an alert and makes the secondary signature mandatory before the form can be successfully submitted.
Open your PDF in form editing mode, right-click the total or sum field, and select Properties.
Click on the Validate tab and choose the option to 'Run custom validation script'.
Enter the following code: if (event.value > 1000) { app.alert("A second signature is required.", 3); this.getField("Signature2").required = true; } else { this.getField("Signature2").required = false; }
Close the properties window, save the PDF, and enter a value greater than 1000 to test if the alert appears and the signature becomes required.

Manage and Edit PDF Forms with WPS Office
WPS Office provides a comprehensive suite of PDF tools, allowing you to easily view, fill, sign, and manage interactive PDF forms on multiple devices with seamless compatibility.
- 1. Open the PDF: Launch WPS Office and open your interactive PDF form.
- 2. Fill the Form Fields: Enter your data into the form fields. Mathematical calculations and scripts embedded in the document will execute as you type.
- 3. Sign the Document: Navigate to the Fill & Sign tab to apply your digital or drawn signature to the required signature fields.
- 4. Save and Submit: Save the completed PDF locally or submit it directly if the form contains an integrated submission button.

Frequently Asked Questions
Why isn't the required signature field blocking the user from saving the PDF locally?
The 'required' property in PDF forms only prevents the submission of the form data (via an electronic submit button). It does not prevent a user from simply saving the PDF file locally to their device.
Can I change the threshold amount in the validation script?
Yes, you can easily modify the script by changing the number in the condition 'if (event.value > 1000)' to whatever numeric threshold fits your specific business rules.
Does this JavaScript validation work on mobile PDF readers?
JavaScript support varies significantly across mobile PDF viewers. While advanced desktop editors fully support these scripts, many mobile apps may ignore custom validation scripts or lack support for dynamic field properties.
How do I ensure the second signature field is targeted correctly in the script?
Check the exact name of your second signature field in its Properties dialog. It must perfectly match the string used in 'this.getField("Signature2")', keeping in mind that field names are case-sensitive.




