Form Fill - Creating Multi-Line under Dropdown
I am working on creating a form filled document in Adobe Acrobat Pro 2020. I have a few fields that require a dropdown with two unique addresses for user to choose from. Currently the field runs the address accross the page and I'd like to to do a multi-line to make better use of space.
I've seen different keystroke scripts for multi-line addresses in discussions over the several years but nothing I've added under Dropdown Properties/Format/Custom Keystroke Script is working? Wondering if I have entered a wrong field in the script below? Should I be entering the addresses as part of the item under Options/Item?
Under General/Name I've entered "Location"
Under Options/Item I have the following Items:
Item: Illinois
Export Value: 0
Item: Henrietta
Export Value: 1
Commit selected value immediately is selected.
Under Dropdown Properties/Format/Custom/Custom Keystroke Script
// Custom Keystroke script for combo box
(function () {
if (!event.willCommit) {
// Set up an array of addresses. \r = carriage return
var aAddr = [];
aAddr[0] = "555 Illinois BLVD.\rNew York, NY 10013";
aAddr[1] = "201 Henrietta St.\rNew York, NY 10019";
// Get the export value of the selected item
var ex_val = event.changeEx;
// Get the corresponding address
var addr = aAddr[ex_val];
// Populate the text field with the address
getField("location").value = addr;
}
})();
