Expand my Community achievements bar.

SOLVED

can 2 values be added to one drop down list item?

Avatar

Level 3

I probably need to explain what it is I am trying to do first. It might not even be possible the way I am trying to do it. So if there is a better way, please do help. But I am trying to have items listed in a drop down list. Specifically items that are different lengths with different item numbers. I have been using the value of the items to do simple calculations for labor. But I also want it so that once an item is selected the item prints to a materials list later on in the form. I am sure I can set the value of the item as the item number and have the item number displayed next to the item (in a different column) later on in the order form. But I want to be able to still perform the calculations within the subform where the original drop down box is contained. Is it possible to assign 2 values (One for use with calculations and one for use as an item number)? Or is there a better way to do what I am trying to do? I know I could just name the drop down list item and contain the item number in the name using addItem. But I dont want to confuse the user with numbers they dont need to see. Only the person selling the materials needs to know the item number, not the user.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Back again...

Thinking about it - the behaviour is expected because the specified values in the Binding tab drive the global binding for the dropdowns.

So if the first dropdown has the text based items as the display values AND the second dropdown has the item numbers as the display items - then it will work. Provided both dropdowns have the same number of items and the sequence in the specified values is the same.

It does mean that you will have to maintain two dropdowns.

It might be a good idea to have the second dropdown (item numbers) set to read only so that the user cannot interact with it.

Good luck,

Niall

View solution in original post

6 Replies

Avatar

Level 10

Hi,

If you can forgive the foreign language, then here is a sample: https://acrobat.com/#d=eBF-l8sBTVN6-jqDUDw6lA

What you are trying to access is the bound value (in the binding tab) and the display value (what the user sees in the dropdown) in the list.

When you select an item from the dropdown, you will see two textfields populate with the bound and display values.

Hope this helps,

Niall

Avatar

Level 3

Okay thats perfect! But I can see that it displays only the text which is the selection of the drop down list. The code for that is getDisplayItem Which I assume is the text that is displayed when you click on the drop down in acrobat. But how would I get it to display an item number of my choosing? Thanks again. Oh by the way, you really know your stuff Niall. Did you go to school for this or did you pick it up along the way?

Avatar

Level 3

I think I figured it out, I just did a test of it. but maybe I did it by accident. form some reason when I created a second drop down list and named it the same as the first one. The second drop down displayed the value set in the binding tab of the first objects script..?!?!?! Was not the result I thought it would be. I guess that might be normal, but I thought for sure it would display the selection text and not the value.

Avatar

Level 10

Hi,

AFAIK it is not currently possible. John Brinkman in this blog indicates that at some date in the future there may be the option of having multiple column list boxes (Populating list boxes).

However at the moment we are stuck with two - display value and bound value.

If you can't use the bound value as the item number (because of calculation requirements), then the simplest option I can think of is to have the item number as the first part of the display value.

If the number of items in the list is not too large, then you could have a switch statement or if statement in the exit event that would look at the selected value and populate another field with the item number (separate to the display value).

Picked it up on the way. Forums, technical guides, Adobe specifications and JP terry's book is great.

Good luck,

Niall

Avatar

Level 10

I would not have expected that either.

If the binding is set to global then both fields should display the same display value.

Glad you have it working,

Niall

Avatar

Correct answer by
Level 10

Back again...

Thinking about it - the behaviour is expected because the specified values in the Binding tab drive the global binding for the dropdowns.

So if the first dropdown has the text based items as the display values AND the second dropdown has the item numbers as the display items - then it will work. Provided both dropdowns have the same number of items and the sequence in the specified values is the same.

It does mean that you will have to maintain two dropdowns.

It might be a good idea to have the second dropdown (item numbers) set to read only so that the user cannot interact with it.

Good luck,

Niall