Skip to main content
AirMobileMedia
Participant
August 8, 2021
Answered

Select company name from dropdown, autofill company address in text field

  • August 8, 2021
  • 1 reply
  • 2420 views

I'm designing a form for work. I've made a drop down box containing the names of different Cellular Providers and I'd like to associate that drop down list with a text field where the selected company's mailing address will auto populate. 

For example, some of the options in the drop down are; AT&T,  , T-mobile & Verizon. 

 

So if the form user selects AT&T from the dropdown, I'd like for the text field to automatically populate with 

AT&T Operational Headquarters

11760 US Hwy 1,

N. Palm Beach, FL 33408 

 

selecting C spire would populate;

Corporate Security Telapex, Inc

1018 Highland Colony Parkway, Suite 500

Ridgeland,MS 39158

 

and so-on.

 

Surly there is a way, I just can't find mine. 

 

Thanks in advance

Todd

This topic has been closed for replies.
Correct answer Nesa Nurani

Since you didn't write name of text field Il just call it "Text1" (replace that with your actual field name) .

Also it looks like you are using multiline text field?

In dropdown field properties,under options tab, check "Commit selected value immediately" and use this script in validation tab of dropdown field:

var f = this.getField("Text1");
if(event.value == "AT&T")
f.value = "AT&T Operational Headquarters\n11760 US Hwy 1,\n N. Palm Beach, FL 33408";
else if(event.value == "C Spire")
f.value = "Corporate Security Telapex, Inc\n1018 Highland Colony Parkway, Suite 500\nRidgeland,MS 39158";
else f.value = "";

 

Add more providers as needed.

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
August 9, 2021

Since you didn't write name of text field Il just call it "Text1" (replace that with your actual field name) .

Also it looks like you are using multiline text field?

In dropdown field properties,under options tab, check "Commit selected value immediately" and use this script in validation tab of dropdown field:

var f = this.getField("Text1");
if(event.value == "AT&T")
f.value = "AT&T Operational Headquarters\n11760 US Hwy 1,\n N. Palm Beach, FL 33408";
else if(event.value == "C Spire")
f.value = "Corporate Security Telapex, Inc\n1018 Highland Colony Parkway, Suite 500\nRidgeland,MS 39158";
else f.value = "";

 

Add more providers as needed.

AirMobileMedia
Participant
August 9, 2021

Thank you very much for your help so far. 

For simplicity, I renamed my text field to text1 to test the script. AT&T works as it should but C spire does not. 

I've attached screenshots of the documents and the full array of properties from the dropdown. 

If you could advise further, I'd appreciate it very much.