Need Dropdown of one form to show another form

New Here ,
Mar 29, 2019

Copy link to clipboard

Copied

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!!!

Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

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

TOPICS
Acrobat SDK and JavaScript

Views

102

Likes

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

Need Dropdown of one form to show another form

New Here ,
Mar 29, 2019

Copy link to clipboard

Copied

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!!!

Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

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

TOPICS
Acrobat SDK and JavaScript

Views

103

Likes

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
Mar 29, 2019 0
Adobe Community Professional ,
Mar 29, 2019

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Mar 29, 2019 1
Most Valuable Participant ,
Mar 30, 2019

Copy link to clipboard

Copied

This line in your code is incorrect:

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

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

Likes

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
Reply
Loading...
Mar 30, 2019 1
New Here ,
Mar 30, 2019

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Mar 30, 2019 0