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

How to visible and hide a drop down list on radio button choice?

Community Beginner ,
Sep 17, 2018 Sep 17, 2018

Copy link to clipboard

Copied

Hi everybody!

I have the following problem and I hope that someone can help me.

I have a three radio-button choice on my PDF-form (R1; R2; R3) and the third one should visible or hide back an drop-down list.

So the code I made is making my drop-down visible, but when I´m choosing R1 or R2 after my R3 choice its not making my drop-down invisible again.

Can anyone see my mistake and help me?

Thank you in advance and sorry for my bad English

if (event.target.value != "Off") {

// box is checked

this.getField("List").display = display.visible ;

} else {

// box is unchecked

this.getField("List").display = display.hidden ;

}

TOPICS
Acrobat SDK and JavaScript

Views

632

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 1 Correct answer

Community Expert , Sep 17, 2018 Sep 17, 2018

OK, then create a (hidden) text field with the following custom calculation script:

this.getField("List").display = (this.getField("L3").valueAsString=="Oil+") ? display.visible : display.hidden;

Votes

Translate

Translate
Community Expert ,
Sep 17, 2018 Sep 17, 2018

Copy link to clipboard

Copied

Where did you place the code? I would not use the MouseUp event of the

radio-buttons for this, but a custom calculation script of a (hidden) text

field, instead.

On 17 September 2018 at 13:37, gizzyk26506996 <forums_noreply@adobe.com>

Votes

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 ,
Sep 17, 2018 Sep 17, 2018

Copy link to clipboard

Copied

It is placed in Action - MouseUp event as you said. So how would you do it then? I don't really get your idea.

Votes

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 ,
Sep 17, 2018 Sep 17, 2018

Copy link to clipboard

Copied

Are the radio-buttons all a part of the same group? If so, what is the group name, and what is the choice value of the third one (the one that you want to use for showing/hiding the other fields)?

Votes

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 ,
Sep 17, 2018 Sep 17, 2018

Copy link to clipboard

Copied

Yes the radio-buttons are all part of the same group. The group name is L3. But I don't know what you mean exactly by choice value?

Votes

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 ,
Sep 17, 2018 Sep 17, 2018

Copy link to clipboard

Copied

The value under Properties - Options - Radio Button Choice.

On 17 September 2018 at 16:02, gizzyk26506996 <forums_noreply@adobe.com>

Votes

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 ,
Sep 17, 2018 Sep 17, 2018

Copy link to clipboard

Copied

Allright, this is "Oil+"

Votes

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 ,
Sep 17, 2018 Sep 17, 2018

Copy link to clipboard

Copied

OK, then create a (hidden) text field with the following custom calculation script:

this.getField("List").display = (this.getField("L3").valueAsString=="Oil+") ? display.visible : display.hidden;

Votes

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 ,
Sep 17, 2018 Sep 17, 2018

Copy link to clipboard

Copied

LATEST

It works perfectly! Thank you so so so much! 🙂

Votes

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