Skip to main content
Participating Frequently
September 17, 2018
Answered

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

  • September 17, 2018
  • 1 reply
  • 1351 views

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 ;

}

This topic has been closed for replies.
Correct answer try67

Allright, this is "Oil+"


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;

1 reply

try67
Community Expert
Community Expert
September 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>

Participating Frequently
September 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.

try67
Community Expert
Community Expert
September 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)?