If I get the user to select a location from a drop down box (Atlanta, Orlando, etc total of 14 locations) then I want to write the address for that location in a text field what is the best way to do this I have tried multiple if statements and haven't gotten good results. any suggestions?
Here is the code I am using.. it pulls the value of Location_1 and then outputs the address
var Location = this.getField("Location_1").value
if (Location = "Atlanta" ) {
event.value = "Barnes HC – Atlanta \n 2030 Powers Ferry Rd \n Atlanta, GA ;30339-5016 \n 678-627-0077 \n";
}
if (Location = "Birmingham") {
event.value = "Barnes HC – Birmingham \n 120 Oxmoor Blvd \n Homewood, AL; \n 35209-0000 \n 205-667-9193 \n";
}
if (Location = " Crestview ") {
event.value = "Barnes HC - Crestview\n 2207 S Ferdon Blvd\n Crestview, FL\n 32539-8458\n 850-683-0888\n O2 Lic #'s ";
}
if (Location = "Dothan") {
event.value = "Barnes HC - Dothan\n 3236 West Main St, Suite 1 & 2\n Dothan, AL\n 36301-4130\n 334-671-1027\n";
}
if (Location = "Gainesville") {
event.value ="Barnes HC – Gainesville \n 1700 NW 80th Blvd \n Gainesville, FL 32606-9177 \n 800-825-1733 \n O2 Lic #'s ";
}
if (Location = "Jacksonville") {
event.value = "Barnes HC - Jacksonville\n 3728 Philips Highway, Suite 32\nJacksonville, FL\n 32207-6840\n 904-301-1050\n O2 Lic #'s";
}
if (Location = "Panama City") {
event.value = "Barnes HC - Panama City\n 2425 Martin Luther King Jr\n Panama City, FL\n 32405\n 800-434-0822\n O2 Lic #'s ";
}
if (Location = "Tallahassee") {
event.value = "Barnes HC - Tallahassee\n 2524 Cathay Court\n Tallahassee, FL\n 32308-4248\n 800-464-8455\n O2 Lic #'s";
}
if (Location = "Tampa") {
event.value = "Barnes HC - Tampa\n 5483 Waters Ave, Suite 1200 N\n Tampa, FL\n 33634 1205\n 813-888-7607\n O2 Lic #'s ";
}
if (Location = "Tifton") {
event.value = "Barnes HC - Tifton\n 2201 US Hwy 41 N Unit K\n Tifton, GA\n 31794-2754\n 866-876-9114\n";
}
if (Location = "Valdosta") {
event.value = "Barnes HC - Valdosta\n 200 S Patterson St\nValdosta, GA\n 31601-5621\n 800-422-5059\n";
}
if (Location = "Waycross") {
event.value = "Barnes HC - Waycross\n 2875 Knight Ave\n Waycross, GA\n 31501\n 866-284-9190 \n";
}
currently I have this under the Calcualation field of the Text Field I want it written on. Is there a better / easier way to do this?
I need it to write the field like this:
Barnes HC - Location Name
Address 1
Address 2
City, State Zip
Phone
O2 Lic#'s
Sorry this is so long. Thanks for any help.