I would like to create a multi-lined text field that automatically populates based on a drop down selection.
I am using Acrobat 8 Professional the drop down box name is locationNames, it has 7 options; San Joaquin/Castaic Room, San Luis Room, Delta Room, Environmental Services, Joint Operations Center, Bonderson Hearing Room, and Headquarters Auditorium. The text field box name is locationDetails, I would like it to populate
"1721 13th Street
Sacramento, CA 95814"
for the first 3 options
"3500 Industrial Blvd.
West Sacramento, CA 95691"
for the 4th
"3310 El Camino Ave.
Sacramento, CA 95821"
for the 5th
"901 P Street
Sacramento, CA 95814"
for the 6th
"1416 9th Street
Sacramento, CA 95814"
for the 7th
I've tried a few different samples however when I enter the actual name of the drop down option it gives me an error. Please help. thanks
// Custom Keystroke script for combo box
(function () {
if (!event.willCommit) {
// Set up an array of addresses. \r = carriage return
var aAddr = [];
aAddr[0] = "1721 13th Street\rSacramento, CA 95814";
aAddr[1] = "3500 Industrial Blvd.\rWest Sacramento, CA 95691";
aAddr[2] = "3310 El Camino Ave.\rSacramento, CA 95821";
aAddr[3] = "901 P Street\rSacramento, CA 95814";
aAddr[4] = "1416 9th Street\rSacramento, CA 95814";
// Associate export values of combo box items
// to corresponding index of address array
var aIndex = [];
aIndex[0] = 0;
aIndex[1] = 0;
aIndex[2] = 0;
aIndex[3] = 1;
aIndex[4] = 2;
aIndex[5] = 3;
aIndex[6] = 4;
// Get the export value of the selected item
var ex_val = event.changeEx;
// Get the corresponding address
var addr = aAddr[aIndex[ex_val]];
// Populate the text field with the address
getField("locationDetails").value = addr;
}
})();
You could simplify this a bit, but my goal was to make it clear.