Skip to main content
Participant
May 17, 2024
Question

Please help! How so I set up a fillable pdf so that checking one box, opens up a signature field?

  • May 17, 2024
  • 2 replies
  • 757 views

Trying to finish up a fillable pdf and am stuck on this last bit. Have a radio box where you can select one of 2 options, and need to get a signature box to appear when 1st radio option is selected.

This topic has been closed for replies.

2 replies

Participating Frequently
May 21, 2024

 

To achieve this in a fillable PDF, you'll need to use JavaScript. Here's a step-by-step guide on how to accomplish it:

  1. Open your PDF form in Adobe Acrobat Pro.

  2. Select the radio button field that allows users to select one of the two options.

  3. Go to the "Properties" panel for the selected radio button field.

  4. In the "Options" tab, make sure each radio button option has a unique name (e.g., "Option1" and "Option2").

  5. Go to the "Actions" tab and select "Mouse Up" as the trigger.

  6. Click the "Add" button to create a new action.

  7. Choose "Run a JavaScript" as the action.

  8. In the JavaScript editor, enter the following code:

 

javascript
Copiar código
if (this.getField("Option1").value == "Yes") { this.getField("SignatureBox").display = display.visible; } else { this.getField("SignatureBox").display = display.hidden; }
 

Replace "Option1" with the name of the first radio button option and "SignatureBox" with the name of your signature field.

  1. Click "OK" to save the action.

  2. Save your PDF form.

Now, when the user selects the first radio button option, the signature box should appear, and it should disappear when the second option is selected.

Remember to test your PDF form to ensure that it behaves as expected.

Participant
May 23, 2024

Hello,

I tried that code but it is sayiError: missing ; before statement 2: at line 3". I have tried to put the semi colon in a few different spots but am not getting any luck. Would you know how to correct this? Thanks!

Participant
May 23, 2024

Looks like I had a typo^ The error message I am getting says "SyntaxError: missing ; before statement 2: at line 3"

Nesa Nurani
Community Expert
Community Expert
May 18, 2024

As Mouse UP action of checkbox, use this:

 

if(event.target.value != "Off")
this.getField("Signature1").display = display.visible;

 

 

If you need something more complex to hide a field if the checkbox is unchecked, you can use calculate script in any text field (in that case remove the above script if you added it)

 

var check = this.getField("Check Box1").value;
var sig = this.getField("Signature1");
sig.display = (check == "Off") ? display.hidden : display.visible;

 

 

Change "Check Box1" to your actual name of checkbox that will show/hide signature field.

Change "Signature1" to your actual name of the signature field.

 

In case you have mutually exclusive checkboxes:

let's say export value of the checkbox that control signature field display is "Yes", in the calculation script

change: == "Off"

to: != "Yes"