Untitled
unknown
plain_text
2 years ago
1.3 kB
5
Indexable
$("select").change(function () { let vikas = $(this).first() let valuesOfVikasOptions = Array() if (vikas.val() == "" || vikas.val() == '--Select--') { $(this).find("option").each(function () { valuesOfVikasOptions.push($(this).val()) }) $('select').each(function () { if (vikas[0] != $(this)[0]) { if ($(this).val() != '--Select' && $(this).val() != "") { if (valuesOfVikasOptions.includes($(this).val())) { valuesOfVikasOptions.pop($(this).val()) } } } }) } $("select").each(function () { $(this).find('option').each(function () { if (valuesOfVikasOptions.includes($(this).val())) { $(this).removeAttr('disabled') } }); let option = "option[value='" + vikas.val() + "']" if (vikas[0] != $(this)[0]) { $(this).find(option).each(function () { if ($(this).val() != '--Select--' && $(this).val() != '') { $(this).attr('disabled', 'true'); } }) } }) })
Editor is loading...