Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).

New Forum | Previous | Next | (P-PDF) Beginners

Topic: Re: Combo box tied to fields javascript question (Via Email)
Conf: (P-PDF) Beginners, Msg: 111540
From: prodok
Date: 5/15/2004 07:55 PM

Actually, there might be am even more efficient approach.

In the Acrobat JavaScript implementation, arrays work very well and are

very fast. Therefore, defining and initializing arrays at document
level is not such a bad thing, and it is very easy to maintain arrays
at document level too.

One thing which already could speed things up in comparision to the
instant array creation approach described here would be an implicit
array definition, which means that instead of a text string which then

gets chopped up into array elements (using the split() method) uses a
string which is already an array. that would look somewhat like this:

display option export value
"ALB" ["7601 Bluewater NW", "Albuquerque", "NM",
"87121", "505-833-9554"]

And then refer to the the individual elements of the export value.

The next speed-up (IMHO) would be using the popUpMenu() method, because

if it is "only" for selecting something, with no further display
information need, this approach would be faster than dealing with a
Combo Box field.

To prepare for that case, you would instead define your location array

as document level array, and keeping the information in a consistent
manner. In order to keep things together, you would create a
multi-dimensional array, where for example your address information is

formed as an array (such as above), and itself it is an element of the

locations array. Then you could build up the selection list
instantaneously, whenever you need it. You would then either return the

index of the element in the master array, and use that one to refer to

the individual pieces, or you would return the whole address array and

refer to that one.

If you can freely work with Acrobat 6, things got even easier, as you
now have a few more options with popup menus.

Also note that it is easier to organize information in a popup menu,
because it would allow for hierarchical menus, avoiding those annoying

long 1-dimensional combo boxes.

Hope, this can help.

Max Wyss
PRODOK Engineering
Low Paper workflows, Smart documents, PDF forms
CH-8906 Bonstetten, Switzerland

Phone: +41 1 700 29 21
Fax: +41 1 700 20 37
or +1 815 425 6566

[ Building Bridges for Information ]


Shameless Plug:

My next conference appearances and workshops:
Conference presentations at the 2004 Symposium of the BFMA, May 23
27 in Reno, Nevada ( and pre-/post-conference
workshop, May 22/23 and 27, organized by essociates Group
During the Symposium, I will be available to attendees for ad-hoc
consulting at a hourly basis; please contact me in private for
And, as always, available for on-site


> If I can make a suggestion, you could use a completely different
> approach
> that might be easier to manage.
> Add the options to your destination combo box as follows
> display option export value
> "ALB" "7601 Bluewater NW~Albuquerque, NM
> 87121~505-833-9554"
> "ATL" "1800 James Pkwy NW~Atlanta, GA
> 30369-9751~404-792-3126"
> etc....
> then use this basic JS to populate the other fields
> var des = this.getField('destination');
> var strt = this.getField('street');
> var csz = this.getField('citystatezip');
> var phn = this.getField('phone');
> var desArr = des.valueAsString.split("~")
> strt.value = desArr[0];
> csz.value = desArr[1];
> phn.value = des[2];
> Its another way of getting where you want to go without
> having to manage all those separate arrays !

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.