Skip to main content
lindsayl84286663
Participant
August 13, 2018
Answered

Multiple Selections in Dropdown

  • August 13, 2018
  • 2 replies
  • 15855 views

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!

This topic has been closed for replies.
Correct answer George_Johnson

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.


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

2 replies

lindsayl84286663
Participant
August 14, 2018

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

try67
Community Expert
Community Expert
August 14, 2018

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

lindsayl84286663
Participant
August 14, 2018

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

try67
Community Expert
Community Expert
August 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.

Participant
June 1, 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"} ]
}
)

 

Thom Parker
Community Expert
Community Expert
June 1, 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 PDFScriptingUse the Acrobat JavaScript Reference early and often