Adding custom text field to a drop down menu

New Here ,
Apr 14, 2022 Apr 14, 2022

Copy link to clipboard

Copied

This is kinda hard to explain so bare with me...

 

We have this Employee Review spreadsheet created in Excel so we could have drop down menus as well as one particular custom drop down menu that when you select one of the 4 options, it also puts in a text field with something that goes along with the drop down menu choice.

 

For example: when you choose the option "Exceeds Expectations" from the drop down menu, it also puts down a text field that says "Employee consistently performs at a high level that exceeds expectations".

 

Im curious of how to go about this in Acrobat Pro DC.

 

I know how to make drop down menus in APDC, but to add an additional text line is where im stuck.

 

Can APDC do this?

 

Thanks in advance for any help!

 

-Shane

TOPICS
How to

Views

75

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
community guidelines
Adobe Community Professional ,
Apr 14, 2022 Apr 14, 2022

Copy link to clipboard

Copied

Sure. As the custom calculation script of that text field enter the following code:

 

event.target.display = this.getField("Dropdown1").valueAsString=="Exceeds Expectations" ? display.visible : display.hidden;

 

(replace "Dropdown1" with the actual name of the field, of course)

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
community guidelines
New Here ,
Apr 14, 2022 Apr 14, 2022

Copy link to clipboard

Copied

so, in the Calculate tab, i input that code and my drop down menu simply disappeared!

 

what did i do wrong?

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
community guidelines
Adobe Community Professional ,
Apr 14, 2022 Apr 14, 2022

Copy link to clipboard

Copied

You put it in the wrong place. It should go under the text field, not the drop-down...  You can manually make the drop-down visible again, via Properties - General.

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
community guidelines
New Here ,
Apr 14, 2022 Apr 14, 2022

Copy link to clipboard

Copied

so wait, are you say i need to add a Text Field under the drop down menu and put that code in there?

if so, will i have to do this 4 times as the 4 options in the drop down  menu have different text associated with them.

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
community guidelines
Adobe Community Professional ,
Apr 14, 2022 Apr 14, 2022

Copy link to clipboard

Copied

Isn't that what you described? Having a separate text field show up when a specific value is selected in the drop-down? If you have 4 options, each one with a unique text, then you can use a single text field and populate its value using a script. You don't need to create 4 separate fields for that.

The code for that would be something like this:

 

var v = this.getField("Dropdown1").valueAsString;
if (v=="Exceeds Expectations") event.value = "Employee consistently performs at a high level that exceeds expectations";
else if (v=="Fails") event.value = "Terrible."; // etc.
else event.value = "";

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
community guidelines
New Here ,
Apr 14, 2022 Apr 14, 2022

Copy link to clipboard

Copied

LATEST

i see. ok. im gonna give that a shot and see if that will work and get back to ya!

 

i appreciate all the help!!!

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
community guidelines