Copy link to clipboard
Copied
I've been trying for 3 days to make it where when I chose an address in a dropdown, and have it auto populate the phone and fax number to no avail. I'm using Adobe Acrobat Pro DC. Any help would be appreciated. Thank you.
Remove the line numbers from the code. They should not have been a part of it if you copied it from the website.
Copy link to clipboard
Copied
You can use something like this as the custom validation script of the drop-down field:
if (event.value=="Main Street 1") {
this.getField("PhoneNumber").value = "555 999 1234";
this.getField("FaxNumber").value = "555 999 1235";
} else if (event.value=="Maple Street 12") {this.getField("PhoneNumber").value = "555 678 1234";
this.getField("FaxNumber").value = "555 678 1235";
} // etc.
Make sure to tick the option to commit the selected value of the drop-down field immediately (under Properties - Options) for it to update the other fields as soon as a selection is made.
Copy link to clipboard
Copied
Thank you for you're reply. I copied and pasted the script you sent me and changed the info to mine but I'm still doing something wrong. I have the addresses in a dropdown box, and the phone and fax numbers in their own text boxes for 3 total boxes. Is this correct? Here is a screen shot of what I'm looking at.
Copy link to clipboard
Copied
Remove the line numbers from the code. They should not have been a part of it if you copied it from the website.
Copy link to clipboard
Copied
You are AWESOME!!!!!! Thank you so much! That did it.