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

Underscore character

MJF
Registered: Jan 18 2007
Posts: 33

Hi Thom
You have helped me create a form that enables me to chose a product code from a list in a dropdown box and the product name automatically populates in the textfield underneath. I have since realized that the form would be much easier to use is you chose the product name and the code automatically populates. I have changed the scripting around to make this work. My question is this: The product names consis of more than one word each, so when I created the scripting I had to use the underscore to make it work: eg. var ProName={red_pencil:{code:"pr2h"},
Is it posible to have the product name in the drop down list with a space instead of an underscore and still relate the name back to the sripting.
In other words I want the product name on the form to show up with spacing eg. "Red Pencil" instead of with the underscore (Red_Pensil).
MJ

My Product Information:
Acrobat Pro 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, The text displayed in a list can be anything. For dealing with lists its best to have a central list (look up table) that contains everything you need for each list entry, including the display name, export value, and anything else, then generate the specific list format you need for populating the dropdown field. That way everything keeps in sync.

It looks like your using my lookup table example. Just add another entry that's the display name. Or, you could also put "red pencil" in quotes so that you can use the space character.

var ProName = {"red pencil":{code:"pr2h"}};


Hope this helps,

Thom Parker
WindJack Solutions
[url=http://www.windjack.com]www.windjack.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script