Drop-downs contingent on selection question

Avatar

23-01-2009

I'm trying to make drop-down boxes contingent upon each other. For example: The first box would include color, shape. And depending on which you selected, the second box would either include colors or shapes. Does anyone have any idea how to do this?

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

26-01-2009

You will have to write code to do this. To get the value of the 1st dropdown use DropDownName.rawValue. Write your code on the exit event as the value will not be committed until you exit. Then you can use the DropDownName.addItem(value, value) to populate the dropdown. You will have to add the items one at a time. The 1st value is the value that the user will see in the dropdown. The 2nd value is the one that will be submitted when data is set out of the form. If you want them to be the same only use a single value.