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

Display layer if 2 of 3 field options are selected

Explorer ,
Apr 25, 2018 Apr 25, 2018

Apologies in advance...newbie here...

I am creating a form where I would like for the following to occur:

  • The field is "Position Type" and has three options: Permanent, Temporary, Variable

(I have not yet decided if I want radio buttons or a dropdown; only one selection can be made)

  • If Temporary or Variable are selected, I would like to display text next to the field.
  • If Permanent is selection, nothing should happen.

I created the layer that has the jpg of the text I want displayed and positioned it.

I've searched around the forums, web and youtube for some script that I could adapt but haven't found anything.

If you someone could guide me to a resource that could assist, I would be deeply grateful!

TOPICS
Acrobat SDK and JavaScript , Windows
339
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 ,
Apr 26, 2018 Apr 26, 2018

Instead of a layer I recommend you use a button field, with the JPG image as its icon. It's much easier to control the visibility of a field than of a layer, especially when the file is opened.

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 ,
Apr 26, 2018 Apr 26, 2018
LATEST

Here is an article on hiding and showing OCG layers:

https://acrobatusers.com/tutorials/create_use_layers

However, I have to agree with try67, a much better approach is to use a form field.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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