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

combo box custom entry that allows a 2nd field to have a custom entry

suewhitehead
Registered: Jun 3 2008
Posts: 232

I am using Acrobat 9 Pro to make this form as an Acroform.
I have a form with several rows, each row having a combo box with 3 options (68,92,160) plus a blank so that the user can enter a different number. The values are 68 = Charlotte, 92 = Raleigh, 160 = Norfolk, and blank has no value.
I want the entry in the combo box, if it is 68,92, or 160, to put the value for that option in another text field on that same row. I also want, if the user enters a different value, for example 25, to have the 2nd text field allow the user to enter some custom entry also in the 2nd text field. For example, if he enters 25 in the combo box, then he can enter Greenville in the 2nd text field.
How do I do this?

My Product Information:
Acrobat Pro 9.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Set the combobox to "Commit selected value immediatly", enter all of the city values a list items Exports (leaving the export for your empty entry blank) , and then use the custom keystroke event script.

enter something like this

if(!event.willCommit)
{
if(event.changeEx != "")
{
var oFld = this.getField("SecondField");
oFld.value = event.changeEx;
oFld.readonly = true;
}
else
oFld.readonly = false;
}

This code places the export value into the second field if it is not empty. But if it's empty, it sets the second field to writable to the user can enter data into it.


Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.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