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

Show hide from dropdown selection.

Participant ,
Sep 18, 2022 Sep 18, 2022

Copy link to clipboard

Copied

I have a dropdown selection box with several choices.

If I select a specific item, then 3 text boxes below show. Otherwise if any other selection is made, they stay hidden.

This is a script I had before and it is here somewhere, but I can not find it. 😞

 

Thank you

 

TOPICS
JavaScript , PDF forms

Views

1.4K

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
1 ACCEPTED SOLUTION
Community Expert ,
Sep 18, 2022 Sep 18, 2022

Copy link to clipboard

Copied

Let's say your choices to show text fields are "choice1-3" and fields are named "Text1-3", as Validation script of dropdown field use like this (change choices and field names to your actual choices and field names):

if(event.value == "choice1" || event.value == "choice2" || event.value == "choice3"){
this.getField("Text1").display = display.visible;
this.getField("Text2").display = display.visible;
this.getField("Text3").display = display.visible;}
else{
this.getField("Text1").display = display.hidden;
this.getField("Text2").display = display.hidden;
this.getField("Text3").display = display.hidden;}

View solution in original post

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 18, 2022 Sep 18, 2022

Copy link to clipboard

Copied

It's probably under the field's Validation event (custom script option), or under Format - Custom - Keystroke.

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
Participant ,
Sep 18, 2022 Sep 18, 2022

Copy link to clipboard

Copied

Sorry, I meant I cant find it here within acrobatusers. I need the JS, then it goes under Validation I think.

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 18, 2022 Sep 18, 2022

Copy link to clipboard

Copied

Let's say your choices to show text fields are "choice1-3" and fields are named "Text1-3", as Validation script of dropdown field use like this (change choices and field names to your actual choices and field names):

if(event.value == "choice1" || event.value == "choice2" || event.value == "choice3"){
this.getField("Text1").display = display.visible;
this.getField("Text2").display = display.visible;
this.getField("Text3").display = display.visible;}
else{
this.getField("Text1").display = display.hidden;
this.getField("Text2").display = display.hidden;
this.getField("Text3").display = 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
Participant ,
Oct 16, 2022 Oct 16, 2022

Copy link to clipboard

Copied

Hi There. I need to add to this. Each text box has a radio button. It is a button group1 with 3 choices. Choice 1, 2 and 3.

 

So in the script I tried adding the radio but it did not work.

I would like the 3 radio buttons to show or hide with the text box. Can you help?

 

Thank you.

 

Murray

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 ,
Oct 16, 2022 Oct 16, 2022

Copy link to clipboard

Copied

LATEST

Just add this to 'else' part (Inside curly brackets):

this.getField("group1").display = 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