0

So I have a number of dropdown select list controls populated as part of a repeater. They might contain overlapping data, meaning that the first d d list control will have selections:

a 
b
c

Second one:

c
d
e

Third one:

d
e
h

and so on.

So what I would like to do is to srart removing the duplicate items from the reset of drop down controls once the user starts selecting those. I intend to use jQuery for this.

dexter
  • 7,063
  • 9
  • 54
  • 71

2 Answers2

1

Here, the code is ugly, but at least it's short:

var selects = $('select');

selects.change(function() {
    var vals = {};    
    selects.each(function() { vals[this.value] = true; }).get();
    selects.not(this).children().not(':selected').not(':first-child')
        .each(function() { this.disabled = vals[this.value]; });
});

Live demo: http://jsfiddle.net/bnehe/6/

Šime Vidas
  • 182,163
  • 62
  • 281
  • 385
0

Try using the jQuery Form Wizard plugin. See: http://plugins.jquery.com/project/formwizard

aendra
  • 5,286
  • 3
  • 38
  • 57