How to Show a PDF Signature Field When Two Conditions Are Met
Question details
The user needs a PDF form signature field to dynamically appear only when two specific conditions are met simultaneously (e.g., a specific payment method is chosen and another signature field is visible).

- Product
- Device & OS
- not provided
- Scenario
- Configuring conditional visibility for interactive form fields within a PDF document using JavaScript.
- Observed behavior
- The signature field fails to appear because the JavaScript display-state syntax is either missing, incorrect, or improperly evaluating the multiple conditions.
Ensure you have the exact case-sensitive field names used in your PDF form written down, as JavaScript requires precise naming to function correctly.
Use JavaScript Display-State Syntax for Field Visibility
Apply a custom calculation script using correct display-state syntax to evaluate multiple conditions and trigger the field's visibility.
To make a PDF signature field appear conditionally, you must use Acrobat JavaScript to evaluate the state of other fields.
When dealing with multiple conditions, logical operators such as AND (&&) must be used to ensure both the payment-method value and the visibility of the preceding field are checked simultaneously.
Right-click the signature field that needs to be conditionally visible and select Properties from the context menu.
Navigate to the Calculate tab within the Properties dialog box and select the option to input a custom calculation script.
Enter a script combining your conditions using the && operator. To properly test if the other signature field is visible, reference its display property by using syntax like: event.target.display == display.visible.
Verify the exact field names in your script. Open the JavaScript console in your PDF editor to run the script, check for syntax errors, and test the dynamic visibility by modifying the prerequisite fields.

Handle PDF Forms and Signatures Seamlessly with WPS Office
WPS Office provides a comprehensive PDF editor that makes managing forms, adding signatures, and filling out documents straightforward. Whether you are dealing with interactive forms or simply need to sign a contract securely, WPS PDF offers a user-friendly and highly compatible interface.
- 1. Open your PDF file: Launch WPS Office and open the PDF form you need to fill out or sign.
- 2. Access Fill & Sign tools: Navigate to the Fill & Sign or Form tab on the top ribbon to access the signature tools.
- 3. Add your signature: Click on the Sign button to create a new digital signature or insert an existing one into the required field.
- 4. Save the document: Apply the signature to the page and save the updated PDF document securely to your device.

Frequently Asked Questions
Why is my PDF JavaScript not triggering the field visibility?
The script might have syntax errors, or the field names referenced in the code do not perfectly match the actual field names in the form. Ensure you are using the correct 'display.visible' property and that JavaScript execution is enabled in your PDF viewer's preferences.
Can I hide a PDF field instead of showing it?
Yes. You can change the display property to 'display.hidden' within your JavaScript conditional statement to hide the signature field when specific criteria are met.
Do all PDF viewers support JavaScript form calculations?
No, not all PDF readers or browser extensions support JavaScript execution for interactive forms. For advanced forms relying on custom scripts, it is highly recommended to instruct users to open the file in a full-featured PDF editor like Adobe Acrobat or WPS Office.




