Skip to content
Advertisement

Python Dash: Exclude option from one dropdown when chosing the same option in another dropdown

I am working on a Python Dash dashboard and have two dropdowns with the same options:

enter image description here

When I select an option in the first dropdown, how do I exclude the same option from the second dropdown? – So that I cannot choose the same material with both dropdowns.

Where and how would I do this in my code? I suppose it must be somewhere in my callbacks?

Any help is highly appreciated.

JavaScript

Advertisement

Answer

You can certainly do this, and you’re most of the way there. Use the value from the first dropdown to modify the options for the second one. Here’s a way:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement