Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
11

How do I create a list that will populate information based off what is chosen in a drop down list?

Explorer ,
Dec 25, 2023 Dec 25, 2023

I want to create a drop down list when the names of tow companies.

Under the drop down list, I assume I would add a text box (?) that would then provide the address, phone/fax numbers for the tow company selected.

Can someone tell me how to do this?

I greatly appreciate any assistance that can be provided.

Thank you,

Valerie

TOPICS
PDF forms
941
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Dec 26, 2023 Dec 26, 2023

You would put script in the dropdown field.

If you create text field and goes to that field properties → options tab, there is an option to check for multiline field (if you want address and phone to be in one field) in that case you would need slightly different script, here is an example:

let's say text field name is "Company Info":

var f = this.getField("Company Info");

switch(event.value){

case "Company1":
f.value = "Address1\nPhone1";
break;
 
case "Company2":
f.value = "Address2\nPhone2";
break;

default:
f.value = "";}

\n is new line separator.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 25, 2023 Dec 25, 2023

Are phone/fax and address in the same field, or separate fields for phone and address?

If each is in a separate field, you can find the answer here:

https://community.adobe.com/t5/acrobat-discussions/adress-fields-being-populated-based-on-chosen-dro... 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 26, 2023 Dec 26, 2023

Nesa, thank you for the quick response. I'm just a basic user and learning how to create forms. I've read where others have a drop-down box for items (in my case the name of tow companies), but I don't know where to go from there. What type of field would I create to include the address and phone numbers, as I don't see where I can type more than one line in the options I've looked at?

Once I have the separate fields, then I would use the answer you provided. BTW which field would I place the "validation" script in?

Again thank you for your assistance.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 26, 2023 Dec 26, 2023

You would put script in the dropdown field.

If you create text field and goes to that field properties → options tab, there is an option to check for multiline field (if you want address and phone to be in one field) in that case you would need slightly different script, here is an example:

let's say text field name is "Company Info":

var f = this.getField("Company Info");

switch(event.value){

case "Company1":
f.value = "Address1\nPhone1";
break;
 
case "Company2":
f.value = "Address2\nPhone2";
break;

default:
f.value = "";}

\n is new line separator.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 26, 2023 Dec 26, 2023
LATEST

Thank you so much Nesa, this worked perfectly for me!!!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines