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

Display One of Two Options

Community Beginner ,
Aug 23, 2022 Aug 23, 2022

Copy link to clipboard

Copied

I'm a novice using Adobe Acrobat Pro DC. I created a form for submitting samples for testing. The submitter has the option of selecting one of two labs for testing. Ideally I'd like both lab names displayed as options. When one of the labs is selected, I'd like the lab name and address to be listed and the other lab name to no longer be visible.

 

I've looked online and there are a lot of discussions using coding. I don't believe I have a version of Acrobat that allows me to code. Is what I'm trying to accomplish possible? Perhaps using radio buttons?

 

A portion of the file is attached. The labs are listed at the bottom of the first page. The user will select one of the labs and that information will be listed at the top of the second page.

 

Thanks in advance for any help.

TOPICS
Comment review and collaborate PDF , Create PDFs , PDF forms

Views

85

Likes

Translate

Translate

Report

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

correct answers 2 Correct answers

Community Expert , Aug 24, 2022 Aug 24, 2022

It's not correct. See the code I used in my example file.

Likes

Translate

Translate
Community Expert , Aug 24, 2022 Aug 24, 2022

If you do it like that then you should reverse the code's logic, ie. show the field when its corresponding value is selected, and hide it when it isn't.

Likes

Translate

Translate
Community Expert ,
Aug 23, 2022 Aug 23, 2022

Copy link to clipboard

Copied

Acrobat Pro DC is the latest version and it allows you to code in JavaScript.

 

All the answers that you need to code what appears to be a simple and trivial requirement are posted anywhere and everywhere in these community support forums.

 

How were you able to create a PDF form with Acrobat Pro DC and then a few seconds later you sustain that you don't believe to have a version of Acrobat that allows you to code?

 

Please clarify. 

Likes

Translate

Translate

Report

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 ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

"How were you able to create a PDF form with Acrobat Pro DC and then a few seconds later you sustain that you don't believe to have a version of Acrobat that allows you to code?"

Because he's a novice, as he said in the first line of his post, so he doesn't know all the features of Acrobat Pro.

Likes

Translate

Translate

Report

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 ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

Thank you... I missed that detail.

Likes

Translate

Translate

Report

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 ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

This can be done using a script, to either show/hide the addresses you already added, or to populate a text field with the address for the selected lab. However, you've created an "Adobe Sign" form, where this won't work. So the first step is to revert it back to a normal PDF form. I've implemented the former option for you. See attached.

Likes

Translate

Translate

Report

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 ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

@try67 Thanks for the tip on reverting back to a standard pdf form.

 

I decided to try using radio buttons. I created text fields for each lab listing the name and address of the lab. The first lab text field is named Lab1 and the second is named Lab2. On the first radio button I used this code:

this.getField("Lab1").display.visible
this.getField("Lab2").display.hidden

I used the reverse code for the second button.

I think this will do what I want, but I'm sure the code I am using is incorrect.

Likes

Translate

Translate

Report

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 ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

It's not correct. See the code I used in my example file.

Likes

Translate

Translate

Report

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 ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

@try67 The code you provided worked great! Thanks!

 

I tried putting the text fields containing the lab names and addresses on top of each other so the address displays in the same location for each. This works when one or the other is selected, but both text fields are displayed when “- Select Lab –“ is chosen. Can I add to the code you provided to make both text boxes hidden when “- Select Lab –‘ is chosen?

Likes

Translate

Translate

Report

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 ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

If you do it like that then you should reverse the code's logic, ie. show the field when its corresponding value is selected, and hide it when it isn't.

Likes

Translate

Translate

Report

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 ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

LATEST

Thanks for all of your help

Likes

Translate

Translate

Report

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