Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Do you know what script method can I use, for read text data and do the lookup??
Thanks.
Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
But how do I do the lookup?
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now