I'm using the code below to filter values between two combos. The value of the first does not appear in the second:
$("#treinamento").on('change', function() {
$("#validade_treinamento").prop('required',true)
$("#treinamento_2").removeAttr('disabled');
$('#treinamento_2 option')
.hide() // esconde
.filter('[value!="'+$(this).val()+'"]') // filtro das opções diferentes (!)
.show(); // exibe
});
But what happens now is this: There are two more combos, but five. And the values can not appear in the combos below. In the example below, in combo 2 the value of combo 1 does not appear for selection, but in combo 3 it appears:
Using this logic of the code I already have, is there any way to control the 5 combos so that the values already selected in them do not appear?