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
I just looked at the debugger and got this.
It can't find a entry for cDeptName.
In the item list of dropdown field did you name it right (HEADQUARTERS)?
Yes, in the drop down field (end user) has HEADQUARTERS as well.
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.
I have other drop down selections that has spaces and they match (populate) the address for it.
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.
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.
You can change the fields at Tools > Prepare Form
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!
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?
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.