Copy link to clipboard
Copied
I have a dropdown list in my form made in Adobe Pro DC with 7 entries, some of which are quite long. They do not fit in the space I have designated on the form. Is there a way to script, so that the text wraps and shows all the information?
Thanks in advance.

Copy link to clipboard
Copied
You can include line-breaks in the items when you use a script, but it's an undocumented feature and a bit buggy, so I would advice against it.
Copy link to clipboard
Copied
Thank you for the reply. I have read that in other forums, but unable or do not know the script needed, nor where to place it. I presume Properties/Format/Custom Format Script. Can you point me in the right direction or give me a sample script? I need to try it at least, else will not be able to use it.
Copy link to clipboard
Copied
No, this script doesn't need to be placed anywhere under the field itself. You need to run it from the Console.
An example would be:
var items = ["Item 1\nSecond line of text", "Item 2\nSecond line", "Item 3"];
this.getField("Dropdown1").setItems(items);
After running it you'll see that it looks and behaves in an odd way. For example, the last item will switch locations between being on the first line and the second one...
Copy link to clipboard
Copied
You were right, last became first. Added it as Custom Command, Execute Java Script under Action Wizard. At least I have a place to play and learned another area in PRO!
Copy link to clipboard
Copied
Sorry Try67, I feel like it might take me that many tries. At first it was looking promising. But now I've updated/changed the Execute Javascript and the changes do not show. Then in a new document none of the javascript populates in the drop down. Feel like I'm missing something. Was this not where/how to add it?
Custom Command, Execute Java Script under Action Wizard
Are these commands part of the PDF or my settings for PRO?
Copy link to clipboard
Copied
No, they are not a part of the PDF. They are an Action that resides in
Acrobat. You need to run it on the files that you want to edit in this way,
or use the JS Console, as I've recommended. And of course, if the drop-down
is not named the same you'll need to adjust the code between each run.
On Thu, Jun 22, 2017 at 9:47 PM, Techolicious <forums_noreply@adobe.com>
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more