Highlighted

Drop Down Lists that connect with eachother

Avatar

Guest

19-06-2008

I'm trying to make a form in which I have the following fields:



To:

Company:

Email:

Fax:



Now I want to do a drop down list because I have several contacts, but I want it so that when I chose the person in the "To:" field, it will put the company, email and fax for that person in the rest of the fields. I put the details into drop down menus for the rest of the fields but I can't get it to relate joe shmoe to his email joeshmoe@whatever.com and so on.



HELP!

Replies

Highlighted

pguerett

20-06-2008

Where is the information going to reside that ties the To, Company, Emal and Fax to the user that is selected in the dropdown? Are you going to hard code it or is it in a database somewhere, or maybe a Web Service call?



Once we know that we can point you in the right direction.
Highlighted

Avatar

Guest

24-06-2008

a 'simple' solution.. you could add script to the CHANGE event of the drop down list such as:



if (xfa.event.newText == "Joe Shmoe")

{

emailAddress.rawValue = "jshmoe@snailmail.com";

company.rawValue = "ABC";

}



and so on..
Highlighted

Avatar

Guest

24-06-2008

Sorry for being so annoying, but I'm really really new to using forms, I'm not too bad with computers but I'm just not sure where the change event of the drop down list would be or how I can get to it. Could you please explain a bit more?



Thanks so much
Highlighted

pguerett

25-06-2008

Launch Designer and open your form. Once it comes up Click on the Windows menu and ensure the Scripting Editor is enabled. Below the toolbars but above the form display is a blank area that is the scripting editor. At the top of that area are dropdowns that allow you to pick events as well as scripting language and location. Click on the dropdown that you want to code. Make sure the language in the script editor is set to Javascript and it is set to run at Client. In the event dropdown, choose Change. In the blank area you can add your code. Note that the script editor will show you the code that is associated with the object that has focus.
Highlighted
Highlighted

Avatar

Guest

04-09-2008

Hi,



I would like to hardcode this same example except there are 500 records or more. For example, the user puts the Product Code in the textbox and then the description that matches that Product Code should automatically populate in the Description textbox (which will be read-only).



However, I basically want to put the Product Code and Description into an invisible list box and then loop through the list box to match up the description for the product code the user enters and put that information into the description textbox.



The manager wants no DB connection for these forms.



Thanks.

Vee
Highlighted

pguerett

04-09-2008

So you will hardcode the values in the listbox ....I sure hope one does not change. I would not use a list box because you will have to loop through each enter to get your match. Can you not use some sort of array structure with and index to make it easier and more efficient to make the match?
Highlighted

Avatar

Guest

04-09-2008

Hi, Paul:



Actually, the listbox info would not change; however, more would and could be added to the list.



I am very interested in using an array structure with an index. How do I even get started on that?



I am a beginner programmer so if you can help me get started, I am sure I can finalize.



Thanks for your quick response; still working on this project for which they would like today.



Vee