Skip to main content
Participant
January 13, 2025
Answered

Auto populate image signature/image field from dropdown list

  • January 13, 2025
  • 2 replies
  • 901 views

Hi All, 

 

i've created a fillable PDF form. I have a drop down with a list of names and a field underneath it.

 

I'd like to be able to select any name from the dropdown and for the field underneath to auto populate with the signature of that person. I have all the signatures saved as images (mix of JPG and PNG files). Does the signature field need to be an image field, or text or other? I've tried googling the Java script to make this happen, but i can't quite get my head around it. Any help would be appreciated if you would know the script for this?

 

Thanks

Correct answer Nesa Nurani

You can prepopulate image fields and then show/hide them depending on dropdown choice.
Here is an example script that would go into dropdown validate script (of course change names and image field names to your actual names:

this.getField("Image1").display = (event.value == "John Doe") ? display.visible : display.hidden;
this.getField("Image2").display = (event.value == "Jane Doe") ? display.visible : display.hidden;

2 replies

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
January 13, 2025

You can prepopulate image fields and then show/hide them depending on dropdown choice.
Here is an example script that would go into dropdown validate script (of course change names and image field names to your actual names:

this.getField("Image1").display = (event.value == "John Doe") ? display.visible : display.hidden;
this.getField("Image2").display = (event.value == "Jane Doe") ? display.visible : display.hidden;
gina_4873Author
Participant
January 14, 2025

this also works thankyou

PDF Automation Station
Community Expert
Community Expert
January 13, 2025

Create a button field for each signature and name them exactly the same as the their names in the dropdown.  Set the button layouts to "Icon only".  Import the .png and .jpg files into the buttons so they display the signatures.  Hide the button fields that contain the signatures.  Assuming your image field name is "Image1_af_image" enter the following custom validation script in the dropdown:

this.getField("Image1_af_image").buttonSetIcon(this.getField(event.value).buttonGetIcon())
gina_4873Author
Participant
January 14, 2025

thanks for your reply, i've tried this but still can't get it to work, anything i might be missing? I've set the button field to hidden and done what you've said, but can't get it to show when i select the name from the dropdown.

gina_4873Author
Participant
January 14, 2025

oh it does work! But i have to click away frrom the drop down for the signature to show