Drop-down Menu Formatting issue
Copy link to clipboard
Copied
is there a way to make the text wrap in a drop down menu in adobe forms so I can see multiple lines of text? I need to add options that are too long and don't show on one line.
Copy link to clipboard
Copied
Do you mean an actual popup menu, or do you mean the ComboBox(DropDown) form field?
In the first case, the popup menu does not support multiline items, but the dropdown form field does. The multiline entries are added with a script, like this:
this.getField("Dropdown").setItems(["Red\nApple", "orange", "Red\nPear"]);
The first and last entries use the newline character "\n" to create two lines in those entries.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Sorry I meant drop down menu. I have an item that doesn't fit in the box because it's too long and I need it to have like a multi line or wrap text feature so it will stay it the box whether it's a paragraph or a few words. Hope that is more clear.
Sent from my Sprint Samsung Galaxy S8.
Copy link to clipboard
Copied
So if I use red\npearl then it would show like this as an end result:
RedPeal
Even though I am just selecting red\npearl in the menu?
So if I had a paragraph I could just figure out how many characters long a box is and put a \n at the right spot and all the words would wrap and show in one box?
Sent from my Sprint Samsung Galaxy S8.
Copy link to clipboard
Copied
List items do not automatically wrap lines, but you can hard code newline characters. So yes, if you had a whole paragraph you can manually wrap it by inserting newlines. The selected result is the text with the inserted newline, so your sample result would be
Red
Peal
Since it contains a new line. However, it is easy to replace these newlines with spaces:
var strResult = this.getField("Dropdown1").valueAsString.replace(/\n/," ");
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Thom that didn't work. any other ideas?
The bottom edge needs to be cut up 2” from any hard surface and 4” from landscaping. In some areas bottom edge needs to be sealed properly to not allow insects and moisture from entering the system.
This is what I need to wrap if it helps.
Copy link to clipboard
Copied
I would advice you don't do that. It's an undocumented feature and it doesn't work very well. You'll notice it behaves strangely when you select an item with a line-break.
Copy link to clipboard
Copied
TRY67,
I couldn't even get that to work but I am sure I am doing it wrong. can you please tell me how I would use a line break so I can see what it does? also do you have a different solution? seems kind of strange Adobe offers it in a standard text box but not a drop down menu?
Thanks for your time
Copy link to clipboard
Copied
The code provided by Thom is correct, and is the only why of doing it. This is what it looks like (notice the buggy way in which the "pear" objects moves around):
Copy link to clipboard
Copied
Great. Can you tell me exactly how to do that please
Sent from my Sprint Samsung Galaxy S8.
Copy link to clipboard
Copied
Use the code provided above by Thom. It's what I did...
Copy link to clipboard
Copied
Can you please give me a step by step or point me in the direction of something to read to tell me exactly how to do that.
Sent from my Sprint Samsung Galaxy S8.
Copy link to clipboard
Copied
You mean how to run the script? You should read this tutorial (also by Thom, by the way): https://acrobatusers.com/tutorials/javascript_console
Copy link to clipboard
Copied
That's not what I meant but thanks I will play with it and figure it out.
Sent from my Sprint Samsung Galaxy S8.
Copy link to clipboard
Copied
So what did you mean?
Copy link to clipboard
Copied
1) Where do I copy+paste the script?
2) Which fields do I replace with my own text so it shows up in line 1 and line 2?
I'm in the same boat as bterry302. I think these were the questions s/he was trying to get at.
Copy link to clipboard
Copied
I agree. This is a most frustrating part of Dropdowns. I want to create dropdowns with with multiple options for standardised paragraphs in a form, but the result doesn't wrap to the sides of the box created - very frustrating. What I'm reading in the responses is that you need to be some kind of Javascript code writing guru to make it kind of work. This text wrapping should be the default for any field that can take text or numbers regardless. Adobe - Please fix this. I create forms and documents and I shouldn't also have to become a specialised code writer to achieve what I need to achieve.

