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
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