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

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

Community Beginner ,
Sep 17, 2018 Sep 17, 2018

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
1.3K
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

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;

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

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>

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

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

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

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)?

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

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?

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

The value under Properties - Options - Radio Button Choice.

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

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

Allright, this is "Oil+"

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 ,
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;

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

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

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