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

List box and multiple selection - Populate new text box

Community Beginner ,
Oct 25, 2018 Oct 25, 2018

Copy link to clipboard

Copied

Hello all..

I'm stuck and have been searching for a solution. I have a list box of 30 names. The user needs to select between 3 to 5 names. I am trying to get these names populated in a text box to the right of the list box. I can't find a solution for this and hope someone out there might have an idea. I've tried some JS scripts found here but none have worked so far.

Hope to hear from someone soon.

TOPICS
Create PDFs

Views

3.2K

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

correct answers 1 Correct answer

Community Expert , Oct 26, 2018 Oct 26, 2018

You can use this code as the custom calculation script of the text field (just adjust the field name in the first line):

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

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

else event.value = v;

Votes

Translate

Translate
LEGEND ,
Oct 25, 2018 Oct 25, 2018

Copy link to clipboard

Copied

First, this will require custom JavaScript to accomplish. Do you know how to write JavaScript within an Acrobat form?

See

currentValueIndices​ Example (Read) for coding.

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 Beginner ,
Oct 25, 2018 Oct 25, 2018

Copy link to clipboard

Copied

Thanks;

I have a bit of experience modifying JS. I was hoping there might be some scripts that are similar to what I want to do and use that as a base.

The scripts I have seen so far don't seem to be what I am after. Basically, a user selects 3-5 items from the list box and these items get populated in a text box next to it. That's all I'm looking for.

Thanks

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 Beginner ,
Oct 26, 2018 Oct 26, 2018

Copy link to clipboard

Copied

Anyone have an idea or a similar script I can compare?

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 ,
Oct 26, 2018 Oct 26, 2018

Copy link to clipboard

Copied

You can use this code as the custom calculation script of the text field (just adjust the field name in the first line):

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

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

else event.value = v;

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
New Here ,
Apr 06, 2023 Apr 06, 2023

Copy link to clipboard

Copied

LATEST

TRY67,

 

Another beginner here. Please forgive my Javascript ignorance. I have a one off form to make with multiple selected states. I made a list box of the states but can't seem to get them to the text box. Where exactly does this code go? I have been trying to accomplish the same thing and I am sure I am putting the javascript or the list box/text box names in the wrong place.

Thanks,

Joe

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 Beginner ,
Oct 26, 2018 Oct 26, 2018

Copy link to clipboard

Copied

Brilliant try67​

That was the simplest and most effective solution found. Greatly appreciate your help.

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
New Here ,
Jun 23, 2020 Jun 23, 2020

Copy link to clipboard

Copied

Thanks try67!!!!! I'm new to making PDF Fillable forms.

Your response worked perfectly for me!!!!

 

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