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

Seperating Listbox Items into one line seperated by commas?

New Here ,
Oct 05, 2016 Oct 05, 2016

Is there anyway to separate selected items from a listbox into one horizontal line seperated by commas?  Ex. (Kitchen, Bath, Mudroom)

TOPICS
Acrobat SDK and JavaScript , Windows
556
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 ,
Oct 05, 2016 Oct 05, 2016

Sure. You can use this code as the custom calculation script of the text field where you want to display the list (just adjust the name of the field to match yours):

var v = this.getField("List Box1").value;

if (typeof v=="object") event.value = v.join(", ");

else event.value = v;

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 ,
Oct 05, 2016 Oct 05, 2016

I still didn't have any luck with having the selections to appear.  Forgive me, my knowledge of script and creating forms is lacking.  I've included screenshots of what my listbox currently looks like along with the script that I entered.  

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 ,
Oct 05, 2016 Oct 05, 2016
LATEST

Read my reply above more carefully, please. I've described where you need to place the code.

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