These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Combo Box with state abbreviations

jlj747
Registered: Jul 27 2008
Posts: 31

Is there a way to have a combo box (drop down) with abbreviations without having to enter one at a time?

Such as import it from an Excel spreadsheet.

If so, how do I do this?

Thanks in advance.

My Product Information:
Acrobat Standard 9.0, Windows
maxwyss
Registered: Jul 25 2006
Posts: 255
This is possible, by preparing an according array externally. Have a closer look at the setItems Field Object method.

Essentially, you prepare a simple two-dimensional array, which you then pass to the field with the setItms() command.

Hope this can help.

Max Wyss.
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1875
Another option is to import an appropriately prepared FDF file. I have one I use for just this purpose. Feel free to contact me by e-mail if you'd like a copy.

George

P.S. Hello Max!
jlj747
Registered: Jul 27 2008
Posts: 31
Thanks for your replies.

Excuse my ignorance but I have no idea what Max is talking about.
I am not a programer, just someone who is looking to do a simple thing.

I am suprised that you can not just do a cut and paste.

I just found out what a FDF is. But, I need to do some research on how to get this done and then I will get back to you.
maxwyss
Registered: Jul 25 2006
Posts: 255
Combo boxes and list boxes are not as simple as they may look... and there is no "simple" user interface for an option list. (there are other form systems which do have such things, but not Acrobat).

I believe to remember that Appligent (http://www.appligent.com) has an utility which does what you want. You have a text file and apply it with the utility. Note: I have never worked with this utility.

I have been working on tools to provide a different user interface for forms creation. However, their contents would be beyond the scope of this forum... we'd have to talk in private.

Hope this can help.

Max.
glange
Registered: Sep 25 2008
Posts: 4
If you have LiveCycle, U.S. States are in the Custom Object Library.
jlj747
Registered: Jul 27 2008
Posts: 31
I have the Acrobat 9.0 Standard version.

I will just have to enter them in one at a time.


Thanks.
But if you or anyone else comes up with some other solution that would be appreciated.
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
A portion of the script that can used as a document level function to populate a combo box or list box or be run thforough the JavaScript debugging console:

//define anarray of state name and abbreviation array
var aStateAbrev = new Array(['ALABAMA','AL'],
['ALASKA,[AK'],
['AMERICANSAMOA','AS'],
['ARIZONA', 'AZ'],
['ARKANSAS', 'AR'],
['CALIFORNIA', 'CA'],
['COLORADO', 'CO'],
['CONNECTICUT', 'CT'],
['DELAWARE', 'DE'],
['DISTRICT OF COLUMBIA', 'DC'],
['FEDERATED STATES OF MICRONESIA', 'FM']
);

//Insertarrayofstatesandabbreviationsintothecombobox
this.getField('US.States').setItems(aStateAbrev);

One could even make this into a funciton with a parameter of the combo box or list box to be populated, so as a developer you would only need to call the function from the console and the provided field would be updated. Or one could even make a tool bar button or menu option.

George Kaiser

jlj747
Registered: Jul 27 2008
Posts: 31
Thanks to all for answering my question.

It looks like I may have to teach myself Javascript just to understand what some of you write.
Scoop0901
Registered: Sep 17 2007
Posts: 1
George_Johnson wrote:
Another option is to import an appropriately prepared FDF file. I have one I use for just this purpose. Feel free to contact me by e-mail if you'd like a copy.
George, could you email that FDF tgo me, please? I have an application form for a non-profit I am working on and there are several blocks which require the STATE to be entered.

I am scoop0901 athat big G thing. ;)

Thanks,
Dave

Dave J. (Scoop0901)
Cherokee by blood. American by birth.
Native Philadelphian by birth. Whoo-ahh.

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Dave,

You will need to modify the code to set each state field.

George Kaiser