Reputation: 1041
Let's say I have a list of headers (@headers) containing 4 items ([ItemA, ItemB, ItemC, ItemD]) and a page with 4 dropdowns ([Dropdown1, ... ect]). I want items to be removed from the headers list when they are selected in one of the other dropdowns.
I don't really have any code to show now, because I'm looking more for theory than actual code. I'm guessing this is an AJAX problem, but I don't really know where to start
Upvotes: 1
Views: 1442
Reputation: 2785
I think you can achieve it in two ways.
After selecting any option just make a ajax call and in the same response render the drop down layout with out the selected element from the array.
You can just remove the option using jquery. if you do not need any server side operation . check the link How to remove a selected item from a dropdown list (Using Jquery)
Upvotes: 1