Copy link to clipboard
Copied
Hi,
I'm creating a PDF form with a dropdown list that asks the user a YES/NO question. If NO is selected, I want a popup menu to provide a list of options the user can select from, and displays those choices (user needs to be able to select more than 1) in a text field. I'm all Googled out and really could use some help! I'm the furthest thing from an expert in writing scripts, but I can read/understand how they work and have been successful with some simpler stuff. Can anyone provide any help? It would be greatly appreciated!!
Thanks!
Copy link to clipboard
Copied
Popup menus (app.popUpMenu, app.popUpMenuEx) don't allow multiple selections. If I had to do this I'd use a custom dialog, which allows all sorts of elements, including multiple check boxes. This is probably the most difficult thing to do in Acrobat JavaScript though. You might be able to find some samples out there if you search around a bit.
Copy link to clipboard
Copied
Thanks George... I thought a popup menu would be the way to go.
I want to keep the form short, so am trying to avoid checkboxes and/or radio buttons. Is there a way to have a listbox only display the selections the user made?
Copy link to clipboard
Copied
It is actually possible to use a pop-up menu for multiple selections (using the optional check-marks you can add to it), but it requires a bit of scripting.
Copy link to clipboard
Copied
The check boxes in a custom dialog are not something that get added to the page like regular form fields. Here's a sample document that shows various different types: http://www.windjack.com/resources/Examples/DialogUses.pdf
You can see the scripting each button uses. See the "Control Document Processing" for a multiple check box example.
And though you can add check marks to items using app.popUpMenuEx, once a user selects a single item, the popup goes away, so it's very cumbersome to select multiple items at once.
Copy link to clipboard
Copied
I like that method... would the dialog box be assigned to a text field that would display the choices? (sorry, I'm so green!).
Copy link to clipboard
Copied
You can do that, but it doesn't happen automatically. The behavior is entirely controlled by the scripting, which could check to see which items in the custom dialog the user selected and place corresponding entries in a text field. I'm being vague because I don't have a ready-made example to show you that does exactly what you want. You can either try to figure out how to do it yourself of find someone to do the programming for you.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now