Copy link to clipboard
Copied
I have a dropdown field that allows me to select a variety of vendors. Is there a way to 'link' these vendor names in the dropdown to associated contact info? I would like to be able to select one of the vendors in the dropdown, and then have that choice trigger the autofill of a second field with contact info (address, phone, fax) related to that specific vendor.
Is this possible
Copy link to clipboard
Copied
Not a beginner project.
Changing Another Field with Combo Box (Drop Down) Selection by Thom Parker
Copy link to clipboard
Copied
Any error in the Javascript console?
Copy link to clipboard
Copied
I just looked at the debugger and got this.
Copy link to clipboard
Copied
It can't find a entry for cDeptName.
Copy link to clipboard
Copied
In the item list of dropdown field did you name it right (HEADQUARTERS)?
Copy link to clipboard
Copied
Yes, in the drop down field (end user) has HEADQUARTERS as well.
Copy link to clipboard
Copied
It doesn't look like there are any errors in your code. So there must be an issue with matching the dropdown selection to the DeptData. The item names in the dropdown must match the names in DeptData exactly. Including the case. Also make sure there are no spaces in the dropdown item.
Copy link to clipboard
Copied
I have other drop down selections that has spaces and they match (populate) the address for it.
Copy link to clipboard
Copied
Not spaces as part of the item value, It's spaces on the front and back that are not meant to be part of the value that can make a difference.
The error reported in the console shows that the selection in the dropdown does not match the name in the DeptData. So there is some difference. I just mentioned spaces because they can cause a mismatch, but are hard to spot.
If the difference in the values between the selection and the DeptData is not easy to spot. Then I would suggest adding this line to the top of the "SetFieldValues()" function.
console.println("Dept:" + cDeptName + ":");
This code will show the selections in the console.
Copy link to clipboard
Copied
THANK YOU SO MUCH!! After sleeping on it last night and coming back to it. I checked the drop down and it DID have a space after the S. So adding a space after the S in the code made it work!! Good grief, how I hate codes lol. Thank you for all that has commented and helped.
Is there a way to edit the drop down list after testing it? The fields seems to be uneditable once you close out of building the form.
Copy link to clipboard
Copied
You can change the fields at Tools > Prepare Form
Copy link to clipboard
Copied
OMG I wish I asked this way sooner!! I've been recreating everytime there was a change that was needed!! You all have been a life saver!! Thank you SO MUCH!
Copy link to clipboard
Copied
Can you paste the final code?
Copy link to clipboard
Copied
I would like to know how to link 12345 in 1st dropdown list with Joe Bloggs in 2nd drop down list please.
Should they be drop down lists in the first instance or something else?
Copy link to clipboard
Copied
That's too many entries for a list. And you need to explain the exact behavior that needs to happen on the form. I'd suggest creating a new topic.