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

Link Combo Box field to a text field so the text autofills

jaeller
Registered: Sep 22 2009
Posts: 4
Answered

I am creating a PDF form for mailing specifications. I have created a drop-down list (Combo box field) of choices for who owns the mailing indicia (Company A, Company B, Company C, or Other). I want a text field to automatically fill in depending on what choice the user makes from the drop-down field.

For example, if the user chooses "Company A" in the drop down list, a corresponding text field should then show the number "1234," but if "Other" is chosen, the text field remains blank and editable so the user can enter their own number. I have a feeling this will require some javascript, but I don't know javascript.

Any help would be greatly appreciated!

StevenD
Registered: Oct 6 2006
Posts: 368
Try this.

Remember that the double forward slashes are used to make comments. Commented lines are not executed when the code is run so you can copy and paste them along with actual executable code if you want.

//Put this code in a custom calculation script of the text field you want to choice made in the combo box to appear.

var myCbox = getField("NAME OF COMBOBOX FIELD"); //Insert the name of the combo box between the "".
if(myCbox.value == "Other")
{
this.event.value = "";
}
else
{
this.event.value = myCbox.value;
}

You might want to make sure that each item in the combo box list has an export value for example the item called "Other" should have an export item of "Other".

StevenD

jaeller
Registered: Sep 22 2009
Posts: 4
Thank you! Thank you! Thank you, StevenD!

Your script worked beautifully. You have renewed my faith in mankind. It looks like I'd better get off my butt and start learning some javascript!

Thanks again.
sandybb
Registered: Aug 28 2009
Posts: 6
I have a couple of issue I am trying to work through with combo boxes and text field.

First one is I want to select an item out of the combo box “MODEL OF UNIT” and pull the info from a SERIAL NUMBER text field when I select a SAVE button so it will save to the desk top. Save it as SERIAL NUMBER_ MODEL OF UNIT.

Second one is when I select I item out of the combo box “MODEL OF UNIT” and click on the START button I want to go to the associate page of that MODEL OF UNIT.

I am using Acrobat 9 pro Extend and created the form in Acrobat.

Sandy
jshay88
Registered: Apr 11 2010
Posts: 6
Hi,

I am new to Acrobat and have a question. I would like to link two combo boxes so that when one choice from the first combo box is chosen the next combo box displays only the proper subsequent choices for the user to choose.

I am creating a volunteer application. Each volunteer will have to choose a position to work at the event. For example: front ticket seller, beer sales, front gait greeter, etc... Then they will have to choose a shift time they can work. Each position has two shifts. However, each position has different shift times. For example, the front ticket seller position has two shifts: one from 4:15-8:45 and one from 8:45-11:30. The Front gait greeter has two shifts, but are different times than the ticket seller.

Thus, I would like to have the first combo box (positions choice) linked to the second combo box (shift time) so that when a position is chosen the shift times for only that position are available for the user to choose in the next combo box making the available shift times correlate to the chosen position.

Is there any way to do this? If so could you please explain how to do so step by step using acrobat 9? I have no experience using acrobat. Any info would help.

Thanks,

Josh