Copy link to clipboard
Copied
I have a dropdown box "SHIP" that I have different locations listed. I'm trying to fill in the street address a text field box based on the selection made from the dropdown box. I am VERY new to all of this and am needing guidance from the experts. With the below script I can only get the first selection to appear which is ADAMS. When I select the second choice, DONEHOO, it does not work.
var SHIP=this.getField("SHIP").value;
if (SHIP=="ADAMS") {
event.value="address 1";
} else if (SHIP=="DONEHOO") {
event.value="address 2";
} else event.value="";
Copy link to clipboard
Copied
In the dropdown list does you use the exact the word "DONEHOO" ?
Copy link to clipboard
Copied
Yes. I even checked the spelling.
Copy link to clipboard
Copied
Nowhere any space?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You can use "Donehoo Elementary" in the script.
Copy link to clipboard
Copied
You should not use the same name for the variable and for the field.
var SHIP=this.getField("SHIP").value;
Copy link to clipboard
Copied
Why not?
Copy link to clipboard
Copied
You are awesome! It worked. Thank you so much.
Copy link to clipboard
Copied
This should not be an issue.