-
1. Re: Creating drop down fields... how to properly create 'drop down window'
try67 Feb 11, 2011 8:53 AM (in response to Talyianna)Use a combo-box, not a list-box. What you describe is the default behaviour of a combo-box.
-
2. Re: Creating drop down fields... how to properly create 'drop down window'
George_Johnson Feb 11, 2011 9:13 AM (in response to Talyianna)What do you estimate is the largest number of items you'd ever use? There are other options that you can implement via JavaScript, but it may not be the best approach if you'll have more than about 50 items or so.
-
3. Re: Creating drop down fields... how to properly create 'drop down window'
Talyianna Feb 11, 2011 9:19 AM (in response to George_Johnson)I will be including 56 items in the drop down box. I have tried using the combo box and am seeing the same behavior as when I choose to use the list box
-
4. Re: Creating drop down fields... how to properly create 'drop down window'
George_Johnson Feb 11, 2011 9:26 AM (in response to Talyianna)The two options I had in mind are to use JavaScript to create a popUpMenu or a custom dialog that displays all of the items are once. The first is the easiest to implement but the second is more flexible, but for this type of thing simpler may be better.
Documentation for popUpMenu: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.161.html
Documentation for popUpMenuEX: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.162.html
I won't attempt to explain how to create a custom dialog since it's complicated, but if interested, post again and we can direct you to some resources to learn more.
-
5. Re: Creating drop down fields... how to properly create 'drop down window'
Talyianna Feb 11, 2011 9:35 AM (in response to George_Johnson)Thank you for your help:)
I think the first option "popUpMenu" would work:) Being new to JavaScript, can you tell me exactly what I would type into the script if, say for example, the name of my list field was "Products" and items in the list were "Product 01," "Product 02" and "Product 03" ?
Also, how would I implement this? Would I create a list box first and then assign the action to it?
Thank you,
Christine
-
6. Re: Creating drop down fields... how to properly create 'drop down window'
George_Johnson Feb 11, 2011 10:09 AM (in response to Talyianna)It would be best to get rid of the list box and set up a button and a text box. You could then use code like the following in the MouseUp event of a button that the user would click to make a selection:
// Mouse Up script for button
// Present the user with the list of items
var s = app.popUpMenu("item1", "item2", "item3", "item4", "item5", "item6", "item7", "item8", "item9", "item10");
// Populate the text field with the value the user selected
if (s !== null) {
getField("text1").value = s;
}where "text1" is the name of the text field you're using. Alter this to suit your needs. Make the text field read-only if you dont want the user to be able to alter the contents.
Note that if the list becomes too large, you can set up sub-menu items to break up the list into sub-lists, if that would be appropriate.
-
7. Re: Creating drop down fields... how to properly create 'drop down window'
Talyianna Feb 11, 2011 10:35 AM (in response to George_Johnson)Thank you SO MUCH George!! That works perfectly for me!! This is wonderful:) I fiddled around a bit (with labels and such) until I got it working the way I like:)
Can you do me one last big favor and show me how to set up sub menu items, to break up the lists? I would like to keep these detailed notes on hand for future reference:) I really appreciate your help with this.
Christine
-
8. Re: Creating drop down fields... how to properly create 'drop down window'
George_Johnson Feb 11, 2011 12:43 PM (in response to Talyianna)Try something like:
var s = app.popUpMenu(
["Submenu 1 Title", "SM1 Item 1", "SM1 Item 2", "SM1 Item 3"],
["Submenu 2 Title", "SM2 Item 1", "SM2 Item 2", "SM2 Item 3", "SM2 Item 4"],
["Submenu 3 Title", "SM3 Item 1", "SM3 Item 2"]
);More information is in the documentation linked to above.
-
9. Re: Creating drop down fields... how to properly create 'drop down window'
Talyianna Feb 14, 2011 10:21 AM (in response to George_Johnson)George,
Thank you again for all of your help with this:) Your answers have been very informative and helpful!
Have a wonderful Monday,
Christine


