Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Multi-select popup menu that displays selections in text field - Help!

Community Beginner ,
Aug 04, 2016 Aug 04, 2016

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!

TOPICS
Acrobat SDK and JavaScript , Windows
1.8K
Translate
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
LEGEND ,
Aug 04, 2016 Aug 04, 2016

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.

Translate
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
Community Beginner ,
Aug 04, 2016 Aug 04, 2016

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?

Translate
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
Community Expert ,
Aug 04, 2016 Aug 04, 2016

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.

Translate
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
LEGEND ,
Aug 04, 2016 Aug 04, 2016

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.

Translate
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
Community Beginner ,
Aug 04, 2016 Aug 04, 2016

I like that method... would the dialog box be assigned to a text field that would display the choices? (sorry, I'm so green!).

Translate
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
LEGEND ,
Aug 04, 2016 Aug 04, 2016
LATEST

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.

Translate
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