alex alex - 10 months ago 42
jQuery Question

How to make sure two select menu values are not the same with jquery?

I have two different select menus (menu A and menu B). Both with the same values. How do I make sure selected menu A value is not equal to menu B value onsubmit? Would be cool if the selected menu A becomes non selectable on menu B?

Any suggestions?


Use the following code to diable the option in the second select

 var optionInSelect2 = $('.select2').find('option[value='+$(this).val()+']');
 if(optionInSelect2.length) {