Skip to main content
Participant
Jan 13, 2025 4:12 PM UTC
Answered

Auto populate image signature/image field from dropdown list

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

Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
Jan 13, 2025 4:35 PM UTC

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;

7 replies

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
Jan 13, 2025 4:35 PM UTC

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;
Translate
gina_4873Author
Participant
Jan 14, 2025 10:33 AM UTC

this also works thankyou

Translate
PDF Automation Station
Community Expert
Community Expert
Jan 13, 2025 4:34 PM UTC

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())
Translate
gina_4873Author
Participant
Jan 14, 2025 10:22 AM UTC

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.

Translate
gina_4873Author
Participant
Jan 14, 2025 10:32 AM UTC

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

Translate