I have a group of drop-down boxes that, since the value is used in 1 field, it is disabled, and the background of the value changes to gray in others. It works great. My problem is that when I reset the form, the backgrounds do not return to white, and the values ββremain disabled. I use the usual input type = 'reset "to clear the form. This is the function I use to change the background.
function CheckSelected() {
$(document).on('change', 'select', function () {
$('option[value="disabled"]').prop('disabled', false);
$(this).addClass('exception');
$('option[value="' + this.value + '"]:not(.exception *)').prop('disabled', true);
$('option[value="' + this.value + '"]:not(.exception *)').css('background-color', 'grey');
$(this).removeClass('exception');
});
}
source
share