Prevent duplicate group showing in multiselect that added the group
This commit is contained in:
parent
dd7d34a40e
commit
ffadbfcef3
|
@ -42,7 +42,9 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
var addGroup = function(group) {
|
var addGroup = function(group) {
|
||||||
$('select[multiple]').each(function(index, element) {
|
$('select[multiple]').each(function(index, element) {
|
||||||
$(element).append('<option value="'+group+'">'+group+'</option>');
|
if ($(element).find('option[value="'+group +'"]').length == 0) {
|
||||||
|
$(element).append('<option value="'+group+'">'+group+'</option>');
|
||||||
|
}
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
element.multiSelect({
|
element.multiSelect({
|
||||||
|
|
Loading…
Reference in New Issue