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

Adobe form auto populate field.

Guest
Jun 16, 2016 Jun 16, 2016

I have field 1, 2, 3

If I input A in field 1, it will look up from below data and auto fill field2 with value B and field 3 with value C.

A,B,C

D,E,F

This can be an text file or a database.

Is it possible by using javascript? I will create the form using Acrobat DC Pro, and user to open with adobe reader.

Appreciate any help or suggestion, thanks.

TOPICS
Acrobat SDK and JavaScript
728
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 ,
Jun 17, 2016 Jun 17, 2016

It's possible with a text file, yes, but the file will have to be attached to the PDF itself. Also, it will require writing a custom-made script to achieve it.

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
Guest
Jun 17, 2016 Jun 17, 2016

Do you know what script method can I use, for read text data and do the lookup??

Thanks.

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 ,
Jun 17, 2016 Jun 17, 2016

The basic method to use to read the contents of an attached file is

getDataObjectContents, of the Doc object.

On Fri, Jun 17, 2016 at 10:11 AM, yfz12832227 <forums_noreply@adobe.com>

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
Guest
Jun 26, 2016 Jun 26, 2016

But how do I do the lookup?

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 ,
Jun 27, 2016 Jun 27, 2016
LATEST

After you read the contents of the file you need to parse it (for example, if it's a tab-delimited file you split each line using the tab as the delimiter), and then you use a loop to run over this data and look up the values you need.

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