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

Multiple Selections in Dropdown

Community Beginner ,
Aug 13, 2018 Aug 13, 2018

Hello,

I know this question has been asked a few times, but I couldn't find anything that worked or made sense to me.

I have created a form and I have a few dropdowns that require multiple selection. I don't want to use a list box because I don't like the way they look, they're not easy to use, and they take up too much space. So, I'd like to make it possible to select multiple items in my dropdown lists. I know this might require some javascript, which I have zero experience in.

If you could help me out or give me some clear guidance, I would really appreciate it!

Thank you!

TOPICS
PDF forms
14.9K
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
1 ACCEPTED SOLUTION
LEGEND ,
Aug 14, 2018 Aug 14, 2018

Here's a link to the documentation for the app.popUpMenuEx JavaScript method: Acrobat DC SDK Documentation

View solution in original post

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 13, 2018 Aug 13, 2018

JavaScript won't help. You can't do it with the built-in drop-down field.

It can be done using a pop-up menu, though, which will require doing it using a script to keep track of the items in the list, and whether or not they are selected.

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
New Here ,
May 31, 2020 May 31, 2020

Hi Try67,

 

I've been searching for the way to improve the PDF form. And I see your support is very helpful in Support Community.

 

I can now make MouseUp to populate the submenu. But as you say, we'd require a script to keep the item when selected. I do not need to do multiple selection, but I need submenu to group different products like below. May you please kindly advise how should I keep the item when I select? My first sript is as below:

var cChoice = app.popUpMenuEx

(

{cName: "gigaNOVA", oSubMenu:
[ {cName: "A10192 Fusca"},
{cName: "A10194 Mixtus"},
{cName: "A10340 Calvus"},
{cName: "A10393 Rubra"},
{cName: "A5645 Mica"},
{cName: "A6111 Comata"} ]
},

{cName: "New gigaNOVA", oSubMenu:
[ {cName: "A10192H Fusca-H"},
{cName: "A10194H Mixtus-H"},
{cName: "A10340H Calvus-H"},
{cName: "A5645H Mica-H"},
{cName: "A6111H Comata-H"} ]
},

{cName: "lamiANT", oSubMenu:
[ {cName: "SR4L002 Lucida"},
{cName: "SR4G008 Sinica"},
{cName: "SR4C033-L Latona Left"},
{cName: "SR4C033-R Latona Right"},
{cName: "SR42W001 Mutica"},
{cName: "SR4C005 Similis"} ]
},

{cName: "RADIONOVA", oSubMenu:
[ {cName: "M20047-1"},
{cName: "M20057-1"},
{cName: "M10578-A2"},
{cName: "M10578-A3"},
{cName: "M20048-1"},
{cName: "M20050-1"} ]
}
)

 

111.pngexpand image

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 ,
May 31, 2020 May 31, 2020

What do you mean by keep selection? The popup menu is created dynamically. Do you want the previously selected item marked? Please post to a new thread and explain more clearly what it is you want to do.

You can read more about popup menus here.

https://www.pdfscripting.com/public/Creating-Popup-Menus.cfm

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Jun 01, 2020 Jun 01, 2020
LATEST

You will need to save the selected value somewhere where you can read and write it. For example, in a hidden text field.

Then you use the value of that field to set the bMarked parameter of each item in pop-up menu.

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 14, 2018 Aug 14, 2018

Thanks! How can I create the pop-up menu?

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 14, 2018 Aug 14, 2018

You would need to use the popUpMenuEx method of the app object, which also allows you to define which items are marked.

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 14, 2018 Aug 14, 2018

Sorry, how do I do that? I need an app? I'm sorry, I'm really new to this!

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 14, 2018 Aug 14, 2018

No, this is a script that can run within Acrobat or Reader. If you don't have any experience in writing such scripts then it might be a bit complicated. If you're interested in hiring someone to do it for you feel free to contact me privately (try6767 at gmail.com), and we could discuss it further.

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 14, 2018 Aug 14, 2018

Thanks, but I'd like to get a good handle on how to do this, because we might have to edit and create new forms and I'd like to be able to do that on my own.

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 14, 2018 Aug 14, 2018

Here's a link to the documentation for the app.popUpMenuEx JavaScript method: Acrobat DC SDK Documentation

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 15, 2018 Aug 15, 2018

Maybe it is too complicated... but thanks for sending that.

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