These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Concatenating multiple results into a single text field

PetafromOz
Registered: Jun 8 2009
Posts: 230

I have a list box that allows multiple selection, the results of which are displayed in another text field. That's working fine, but each result is displayed on a separate line and I'd rather it was displayed on a single line separated with commas.

I don't think I can use "+" because there's no fixed no. of results expected, so I can't specify the result in my script. ie. It's a skills inventory with about 20 selections per list category. The user can select none, one or several from each list. So if for example the user selects: OHS, EMS, ISO & QMS, I'd like these displayed in the text field as:

OHS, EMS, ISO, QMS

instead of:

OHS
EMS
ISO
QMS

I assumed I could use the concat function, but I don't know how to tell it to concatenate the results when they're not fixed. eg. I tried this using FormCalc...

TechResults.rawValue = concat(this.rawValue, ",", Space(1), this.rawValue)

It gave me the result I want, but for only 2 items, so if more than 2 are selected, the remainder are displayed as a vertical list. It also duplicates the 2 items that concatenated in with the vertical list. Is there a way to tell it to concatenate all the results, regardless of how many, without having to specify each one?

Perhaps another alternative is to format the output field such that it will display the text the way I want?

Also, I'm happy to go with a JavaScript solution if that will work better.

from way... underground at Parkes - central West NSW - Australia

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
One possibility is using of floating fields.

You can use this example.
https://share.acrobat.com/adc/document.do?docid=cea07c48-f263-4a05-9efa-23f4cceb6bda

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You can cancatenate one of the line terminator characters into your computation.

TechResults.rawValue  = Concat($.rawValue, " #xD",   $.rawValue, "U+000D", $.rawValue, "#xA", $.rawValue)
Of course this code will always crteate three lines and show the "On" and "Off" values.

George Kaiser

PetafromOz
Registered: Jun 8 2009
Posts: 230
gkaiseril it changed the effect, but I still couldn't make it work. I'll keep fiddling...

from way... underground at Parkes - central West NSW - Australia

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Is the value from the combo box an array or series of values seperated by one of the new line characters?

George Kaiser