I\'ve put 2 elements next to eachother. Both of them are using the jQuery Chosen plugin.
This is the code:
Something like this should do it:
http://jsfiddle.net/musicisair/dq97z/10/
// cache selects for use later
var selects = $('.chzn-select');
// whenever the selection changes, either disable or enable the
// option in the other selects
selects.chosen().change(function() {
var selected = [];
// add all selected options to the array in the first loop
selects.find("option").each(function() {
if (this.selected) {
selected[this.value] = this;
}
})
// then either disabled or enable them in the second loop:
.each(function() {
// if the current option is already selected in another select disable it.
// otherwise, enable it.
this.disabled = selected[this.value] && selected[this.value] !== this;
});
// trigger the change in the "chosen" selects
selects.trigger("liszt:updated");
});