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

Export Values to appear as a list.

New Here ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

I have a text box which populates automatially from a dropdown list. However - I need the text in the export value to appear in the text box as a list. How do I add line breaks between items in the export value? 

 

E.g. The dropdown option is "Passing" and the export value says 1) Face target, 2) Raise leg, 3) Kick ball, 4) Follow through.

 

How do I get that text to appear in the text box as:

 

1) Face Target

2) Raise leg

3) Kick ball

4) Follow through

 

Thanks! 

TOPICS
Edit and convert PDFs , PDF forms

Views

205

Translate

Translate

Report

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 ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

First you need to set text field to multiline in field properties, and let's say text field is named "Text1" try something like this as custom calculation script of dropdown field:

var str = event.value;
var items = str.split(", ");
var cList = items.join("\n");
this.getField("Text1").value = cList;

Votes

Translate

Translate

Report

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 ,
Apr 08, 2024 Apr 08, 2024

Copy link to clipboard

Copied

LATEST

First, the text box needs to be setup as multiline.  

Next, there are a couple of ways to insert line feeds into text. 

Sinces it looks like the numbered options are separated with a comma, the esiest thing to do is replace the commas with a line feed.   I don't know how you are currently coding this, so here's just the code for doing the replacement. The "replace" function is the only important part. 

 

var strMultilineValue = strExportValue.replace(/\,/g,"\n");

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

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