HELP! Trying to use two drop down boxes together

New Here ,
Sep 04, 2020 Sep 04, 2020

Copy link to clipboard

Copied

Hi,

I am new to using adobe and I am trying to make two drop down boxes work together. What I need is for the selected item in either drop down to populate the other drop down with the corresponding selection and vice versa. I have been able to make the two separate drop down boxes and put all list items in their respective boxes, but I have no idea how to make the two correspond with eachother. Any help would be much appreciated.

Thanks!

Running Acrobat Pro DC 

TOPICS
Create PDFs , Edit and convert PDFs , How to

Views

756

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
Enthusiast ,
Sep 04, 2020 Sep 04, 2020

Copy link to clipboard

Copied

That doesn't sound to hard to do, but you need to be little more specific. You want it to populate or show specific selection?

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 ,
Sep 04, 2020 Sep 04, 2020

Copy link to clipboard

Copied

I think I want it to show specific selection. I'm not exactly sure. Basically I need the item in either of the selected drop downs to correspond with one another.   I'm making a parts list, one drop down will have part numbers and the other with part descriptions.  Not all my employees will know part numbers or part descriptions but, they will know one or the other, so the drop down selections needs to link together on whatever they select.

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 ,
Sep 04, 2020 Sep 04, 2020

Copy link to clipboard

Copied

In 'Format' tab select 'custom' and then 'Custom format script' and use code below.
In my example if you select first option in dropdown1 it will select 3rd option in second dropdown or if you select option 2 it will select option 1 in second field. Since I don't know what options you will be linking,  you will have to adapt code to your needs.


if (!event.willCommit){
var sel = event.changeEx;
var f = this.getField("Dropdown2");

if (sel == "Selection1"){
f.value = "Selection3";}

else if (sel == "Selection2"){
f.value = "Selection1";}

}

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 ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

So, I've tried adding this code to Dropdown1 and nothing happens. Tried adding it to Dropdown2, still noting. Tried both dropdowns, again, nothing. I'm not getting a syntax error of any kind but no matter what configuration I try, I still get no change when selecting an item from either dropdown box.

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 ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

Sorry about that I mistyped, put the code in "Custom Keystroke Script"

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 ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

Just tried the same all the same things, but added the code to the "Custom Keystroke Script" box. Still nothing happening.

 

Would it help if mention that what i need to happen is, lets say, both dropdown boxes have different lists numbered one item at a time 1-100. I need to be able to pick 1-100 in either dropdown and have it put the corresponding 1-100 in the other.

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
Enthusiast ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

You should have said that from the start. Nesa's code is working but you need to adapt it to your values, change selection 1 to 1 selection2 to 2...etc also it would be good to use loop to go through values so you don't have to write long code, but like I said you should write from start all info.

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 ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

The problem I'm having is not knowing exactly how to ask what it is that i need done. Is there any way I can attach my form for one of you to review? So maybe I will be better able to describe what I need it to do. 

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
Enthusiast ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

You can upload it to google drive or dropbox... and post link here

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 ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

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 ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

The two dropdowns I'm working with are "Dropdown1" under the Part# and "Dropdown2" under the Description.  The listed items in each dropdown coincide with each other in descending order. ie: BAR 1202 in Dropdown1 and 3/8" x 8' whip line 4500 PSI in Dropdown2.

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 ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

If I got it right hopefully, it's easy to do but it will take you long since you didn't give export values to your selections. Just go to "Dropdown2" and in calculate tab select "Value is the" and pick "Dropdown1". Now for the hard part give all your selections in both fields export values, for example:

in "Dropdown1" selection "John" export value 1 in "Dropdown2" selection "Doe" export value also 1. now when you select "John" from "Dropdown1","Dropdown2" will show "Doe" you need to add values like that for all your selections. Give same values to two selections that you want to pair. Hope that is what you looking for.

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 ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

Do I still need to add the "Custom Keystroke Script" code? Then make the changes you've said to the export values?

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 ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

You don't need Custom keystroke code I posted above.

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 ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

Nesa, 

Thank you! That's what I was looking for! One more question on this topic, though I have many more related to this project, How do I make Dropdown2 autofill Dropdown1 like you did with 1 and 2?

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
Enthusiast ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

You just want dropdown 2 to fill dropdown1, or you want at the same time if you select dropdown1 fill dropdown2 or if you select dropdown2 fill dropdown1?

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 ,
Sep 11, 2020 Sep 11, 2020

Copy link to clipboard

Copied

Yes, I want to be able to select dropdow1 to fill dropdown2 and dropdown2 to fill dropdown1.

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 ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

You can also use this code in "Dropdown2" custom calculation script instead of "value is the"

if(event.value = this.getField("Dropdown1").value);
else event.value = "";

 

Here is your file, I changed first 5 selections for you to test ( you will need to do rest of them)

https://drive.google.com/uc?export=download&id=1B8IS7G9ujAduzavSoJ_rj3KMks6mblvw 

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

Copy link to clipboard

Copied

Hi! I am looking for some help. This did not work for me when I was trying to make two drop downs work for each other. I'm sure I'm missing something. 

 

In Dropdown3 - I went into the Calculate tab and selected "Value is the.." it requires me to select sum, product, average, minimum or maximum. Then in the field below I chose Dropdown2. (see images)

 

In Dropdown2 - I went into the list and added Export Values for each list item. Then in Dropdown3, I corresponded those Export Values with what is in Dropdown2. When I select "Agricultural" in Dropdown2, it still gives me all options in Dropdown3. 

I'm not good with code in Adobe, so all help is greatly appreciated! dropdown3.PNGdropdown3 Corresponding Export Value.PNGdropdown2 options.PNG

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

Copy link to clipboard

Copied

It all depends what you wanna do, do you just want to match option in dropdown 3 when you select one from dropdown2 or you also want to do it in reverse dropdown3 to dropdown2?

In your 2nd or 3rd photo look at the bottom and where it says 'Commit selected value immediately' check that box.

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 19, 2022 Apr 19, 2022

Copy link to clipboard

Copied

I would like to have it so when the user selects an item from Dropdown2, only the list items in dropdown 3 that correspond with that specific item show up and the user can select one of those. 

For example, in Dropdown2 I have Agricultural and Animal Feed. When the user selects Agricultural, I only want options in Dropdown3 to be Corn Wet Milling, Oilseed Complex, Oilseed Extraction, Oilseed Preparation, Press Extraction, Sugar or Other. When I check that box in both, and select Agricultural in Dropdown2, in Dropdown3 it starts on Corn Wet Milling (which is a corresponding choice for Agricultural), but it still shows the options for Animal Feed. 

 

Is there a way to not show all the options in dropdown3 when a specific option is selected in dropdown2? 

 

Thanks!

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 19, 2022 Apr 19, 2022

Copy link to clipboard

Copied

You need to use setItems(), as 'Validation' script of "Dropdown2" use this:

var drop3 = this.getField("Dropdown3");
if(event.value == "Agricultural")
drop3.setItems(["Corn Wet Milling", "Oilseed Complex", "Oilseed Extraction"]);
else if(event.value == "Animal Feed")
drop3.setItems(["Oilseed Preparation2", "Press Extraction2", "Sugar or Other"]);

 

Just change what items show for which choice.

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 19, 2022 Apr 19, 2022

Copy link to clipboard

Copied

That works! Thank you!

 

One more question, when I use that code, it does bring up only the options I need, but for Agricultural it shows a "1" too and Animal Feed it shows a "2" in the list options. How do I remove that? 

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 19, 2022 Apr 19, 2022

Copy link to clipboard

Copied

LATEST

I figured out how to remove the 1 and 2. Thank you again for your help!! You have saved me a TON of time!

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