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

Visibility of Single Field Dependent on Multiple Fields

Guest
Dec 08, 2016 Dec 08, 2016

Copy link to clipboard

Copied

Hello Again,

I now need to switch the logic around from my previous question.

I have one dropdown field that I would like to appear dependent on the four other dropdown fields all answering Yes to their question.

Guessing I would have to run some kind of validation script, but not sure how to link them all together.

As Always Thank you

TOPICS
PDF forms

Views

509

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 , Dec 09, 2016 Dec 09, 2016

Something like this:

var b1 = this.getField("Dropdown1").value=="Yes";

var b2 = this.getField("Dropdown2").value=="Yes";

var b3 = this.getField("Dropdown3").value=="Yes";

var b4 = this.getField("Dropdown4").value=="Yes";

this.getField("Dropdown5").display = (b1 && b2 && b3 && b4) ? display.visible : display.hidden;

Votes

Translate

Translate
Guest
Dec 09, 2016 Dec 09, 2016

Copy link to clipboard

Copied

Bump

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 ,
Dec 09, 2016 Dec 09, 2016

Copy link to clipboard

Copied

I would use the calculation script of a (hidden) text field to achieve this, instead of placing a script under each of the drop-down 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
Guest
Dec 09, 2016 Dec 09, 2016

Copy link to clipboard

Copied

What might that look like?

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 ,
Dec 09, 2016 Dec 09, 2016

Copy link to clipboard

Copied

Something like this:

var b1 = this.getField("Dropdown1").value=="Yes";

var b2 = this.getField("Dropdown2").value=="Yes";

var b3 = this.getField("Dropdown3").value=="Yes";

var b4 = this.getField("Dropdown4").value=="Yes";

this.getField("Dropdown5").display = (b1 && b2 && b3 && b4) ? 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
Guest
Dec 09, 2016 Dec 09, 2016

Copy link to clipboard

Copied

I replaced the Dropdown selections with my field names tripled check for spelling errors but it isn't doing anything.

Is there something I'm missing?

var b1 = this.getField("Field 1").value=="Yes"; 

var b2 = this.getField("Field 2").value=="Yes"; 

var b3 = this.getField("Field 3").value=="Yes"; 

var b4 = this.getField("Field 4").value=="Yes"; 

this.getField("Field 5").display = (b1 && b2 && b3 && b4) ? 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 Expert ,
Dec 09, 2016 Dec 09, 2016

Copy link to clipboard

Copied

Are there any error messages in the JS Console? If not, can you share the

file (via Dropbox, Google Drive, Adobe Cloud, etc.)?

On Fri, Dec 9, 2016 at 11:30 PM, chughes919 <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
Guest
Dec 15, 2016 Dec 15, 2016

Copy link to clipboard

Copied

LATEST

Got it to work.  Some complication on my end.  Thank you for the script!

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