Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Dropdown selection makes image appear

Community Beginner ,
Jun 26, 2019 Jun 26, 2019

I have a form where I would like the selection from a dropdown list to make an associated image appear. For example, a dropdown list with Meg, Jane, Chris and Trevor. Selecting 'Meg' would have the photo of Meg appear but not the other three. Selecting 'Jane' would make Meg's photo disappear and Jane's appear.

The form has previously just had two names, so I've been using radio buttons. I've had the images as button fields set to 'hidden', then clicking Meg's radio button would make Meg's button 'visible' and Jane's 'hidden', and vice versa for Jane.

I now have another two names to add to this situation, so the radio buttons are going to be too messy and crowded, hence the need for a dropdown, but I don't know how to make it function. I know Javascript is going to be needed but I don't know nearly enough to be able to extrapolate from what I've found, least of all how and where to apply it to a PDF form.

(Alternatively, the images are in fact signatures. I know digital signatures exist, but my client doesn't want this, rather they want something that will print as their actual signature. If an image file of someone's scanned signature can be used in place of Adobe's autogenerated digital signature, that would be the ideal solution.)

Thanks all!

Anna

TOPICS
PDF forms
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 27, 2019 Jun 27, 2019

You can use images in field buttons.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 30, 2019 Jun 30, 2019

Yes, that's what I've been doing as mentioned in the question. I've been using radio buttons to control the show/hide in previous versions of the form, but now there are too many options to neatly fit radio buttons in the space so I need to perform the same show/hide function with a dropdown list.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 27, 2019 Jun 27, 2019

As mentioned, you can place the images as the icons of button fields, and then show/hide them using a simple script.

See this tutorial for more details: https://acrobatusers.com/tutorials/show_hide_fields

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 30, 2019 Jun 30, 2019

Yes, that's what I've been doing as mentioned in the question--all those scripts you've linked are only relevant for radio buttons and checkboxes, not dropdown lists.

How do I make each option on the dropdown list show/hide the relevant images?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 01, 2019 Jul 01, 2019
LATEST

The basic code is the same, it just needs to be tweaked a bit.

For example, if the image of Meg is a button field called "Image_Meg" you can use this code as the custom validation script of your drop-down:

this.getField("Image_Meg").display = (event.value=="Meg") ? display.visible : display.hidden;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines