Skip to main content
Participant
March 30, 2019
Answered

Need Dropdown of one form to show another form

  • March 30, 2019
  • 2 replies
  • 508 views

I know I have seen this post but nothing is as specific as I need it to be and I know I am doing something wrong.

I made this form in Word and transferred it over to Acrobat Pro DC

In the drop-down box (Emergency Landing / Crash) I have 3 options. When I pick one, I am trying to get a new fillable PDF form to appear. I have each form needed on the same PDF page.

This is one of the forms that I need to "appear" when I click one of the options:

So I've Inserted the JS into the Validate area:

if (event.value == "Emergency Landing / Crash Form")

{

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

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

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

}

else if (event.value == "Incident at Aircraft Destination Form")

{

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

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

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

}

else (event.value == "Medical Emergency Form")

{

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

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

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

}

The Problem is I cannot name the other forms. I've even put text boxes with "form1" etc over the form itself thinking it would work, but it doesn't. I do know some JS but I'm not an expert so any advice would be appreciated.

JIC this is what the first page of my PDF looks like:

Thanks again!!!

This topic has been closed for replies.
Correct answer Bernd Alheit

You can display/hide form fields, but not whole forms.

2 replies

try67
Community Expert
Community Expert
March 30, 2019

This line in your code is incorrect:

else (event.value == "Medical Emergency Form")

If you include a condition it must start with "else if".

Participant
March 30, 2019

Thank you so much! I always mess if else statements up!

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
March 30, 2019

You can display/hide form fields, but not whole forms.