Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

How Do I: Drop-down list dependence

Avatar

Level 2

I need to put 2 drop-down lists in a form.

The first will be named "Occupation" and the second will be named "Title."

When I make a selection in the first "Occupation" drop-down list, the second "Title" drop-down list will appear.

Here's the kicker...

The second "Title" drop-down list must contain a unique set of items that pertain to the item selected in the first "Occupation" drop-down list.

Example:

In first drop-down list "Occupation" select item called "Analyst"

The second drop-down list "Title contains 2 items:  Data Analyst, Financial Analyst

In first drop-down list "Occupation" select item called "Clerk"

The second drop-down list "Title contains 3 items:  Admitting Clerk, Data Entry Clerk, Staffing Clerk

I do not know much about scripting, so specific instructions (or better, an example PDF file) would be highly appreciated.

7 Replies

Avatar

Former Community Member

Where is the list of occupations and Titles that will populate the DDList coming from? Are you hard coding them or are they coming from somewhere else?

Paul

Avatar

Level 2

Thanks for your reply, Paul.

At this time, the items would be hardcoded into each DDlist.

(We are not pulling any information for a field from a database or anything like that.)

Avatar

Former Community Member

OK then it will have to be done through script ....if you want to mock up a quick example I will show you what the code will look like.

Paul

Avatar

Level 2

I have attached a mock-up of the file with the 2 DDlists shown.

I populated the first DDlist (Occupation) with some items... but didn't populate the second DDlist (Title) with anything b/c the contents will change depending on the selection in the first DDlist.

Avatar

Former Community Member

Here you go ....the code is on the exit event of the Occupation DDList.

Paul

Avatar

Level 2

Paul, you are my saviour!!!

Thank you VERY MUCH.

Glenn