Reputation: 1
I wrote a script that can add dropdownlist with button, and every dropdownlists can't select the same value from database.
$(document).ready(function(){
$("select").change(function() {
$("select").not(this).find("option[value="+ $(this).val() + "]").attr('disabled', true);
});
});
But still it is not working.
Upvotes: 0
Views: 30
Reputation: 639
$("select").not(this).find("option[value="+ $(this).val() + "]").attr('disabled', true);
..should be:
$("select").not(this).find("option[value='"+ $(this).val() + "']").prop('disabled', true);
Upvotes: 1