PDF Editing Issues

How to Show a Signature Field After Radio Buttons Are Selected in PDF

Algirdas JasaitisAlgirdas Jasaitis Nov 5, 2026 869 views

Question details

The user wants to reveal a signature field in a PDF form only after specific radio buttons (like a Yes/No option) are selected.

How to Make a PDF Signature Field Appear After Selecting Radio Buttons
Product
PDF
Device & OS
not provided
Scenario
Creating interactive PDF forms with conditional logic where a signature block remains hidden until mandatory form fields, including radio buttons, are completed.
Observed behavior
The JavaScript correctly checks text fields and dropdowns but fails to recognize the selection state of the Yes/No radio buttons, keeping the signature field hidden.
Before you start

Before modifying the form's JavaScript, ensure that your Yes/No radio buttons belong to the same group (share the same field name) and have properly assigned export values.

Solution 1Recommended

Update JavaScript to Use the Display Property for Radio Groups

Instead of using the `.hidden` property on individual fields, check the radio group's selected value and toggle the `.display` property.

Radio buttons in PDF forms function differently than standard text fields. Treating each button as an independent text field often causes conditional logic to fail. You must evaluate the radio-button group as a single entity and use the display property to show or hide the target signature field.

1
Open Form Editing Mode

Open your PDF form in editing mode and locate the JavaScript script that runs the validation check for your fields.

2
Identify the Radio Button Group

Ensure your radio buttons share the exact same Group Name. Check the properties of the group to confirm that a selected export value (e.g., 'Yes' or 'No') is correctly assigned when an option is chosen.

3
Modify the Hidden Property Syntax

Locate the lines of code using `.hidden = false;`. Delete these lines, as the hidden property is often unreliable for grouped objects.

4
Apply the Display Property Logic

Replace the old logic with the `.display` property. For example, insert: `this.getField("Completed By").display = bEmpty ? display.hidden : display.visible;`. This statement correctly evaluates if the required fields are empty and toggles the signature field's visibility.

5
Save and Test the Form

Save your PDF document, switch to the preview or hand tool mode, and test the form by filling out the text fields and selecting a radio button to confirm the signature field appears.

Update JavaScript to Use the Display Property for Radio Groups
Verify Export Values: If the script still fails, double-check that your radio buttons actually have specific export values set in their Options tab. Without export values, the script cannot evaluate if an option was chosen.

Easily Manage PDF Forms and Signatures with WPS Office

If you are struggling with complex JavaScript logic for PDF forms, WPS PDF provides a user-friendly interface to create interactive forms, add fillable fields, and securely insert electronic signatures with ease.

  1. 1. Open the PDF File: Launch WPS Office and open your PDF document using the built-in PDF editor.
  2. 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to easily insert interactive elements like text fields, checkboxes, and radio buttons.
  3. 3. Add an Electronic Signature: Go to the 'Fill & Sign' tab, click on 'Sign', and create your electronic signature to place anywhere on the document.
  4. 4. Save and Share: Save your interactive PDF document. It will remain fully compatible with standard PDF readers.
Easily add and edit PDF text fields, checkboxes, and radio buttons.Insert secure electronic signatures with just a few clicks.Fully compatible with standard PDF formats and Adobe Acrobat forms.Lightweight and runs smoothly on Windows, Mac, and mobile devices.
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't the .hidden property work for my PDF radio buttons?

Radio buttons function as a group rather than independent fields. Instead of using the `.hidden` property, Acrobat JavaScript relies on the `.display` property (using `display.hidden` or `display.visible`) to correctly toggle visibility based on the group's selection state.

How do I correctly group radio buttons in a PDF form?

To group radio buttons, you must assign the exact same Name to each button in their Properties menu. Then, in the Options tab, give each button a unique Export Value (such as 'Yes' or 'No') so the form logic can identify which specific option was selected.

Can I test the PDF form script without closing the editor?

Yes, you can use the JavaScript Console to test scripts in real-time or simply switch from form editing mode to Preview mode (or the Hand Tool) to interact with the radio buttons and verify if the signature field appears as intended.