Reputation: 718
How to make an option in select box readonly not disabled using jquery? I have a multiple select box for selecting roles and a single select primary role.
Now i want to make the selected option in primary role to automatically checked in roles multiple select box in read only mode.
Any help will be appreciated
Upvotes: 3
Views: 6139
Reputation: 2874
$('select').change(function() {
$(this)
.siblings('select')
.children('option[value=' + this.value + ']')
.attr('disabled', true)
.siblings().removeAttr('disabled');
});
Upvotes: 1