こんにちは、チェックボックスである複数選択ボックスがあります。ここでは、既存の選択された値に値を追加し、既存の選択された値から値を削除し、選択されたすべての値を選択された値で上書きするように設定します。これらの試みから結果が得られていないため、少しのガイダンスをいただければ幸いです。ありがとうございました
$('.add_button').click(function() {
selected=$(this).val();
id=$(this).attr('id');
$('#opdots-bach-edit', 'option:selected', this).add();
});
$('.remove_button').click(function() {
selected=$(this).val();
id=$(this).attr('id');
$('#opdots-bach-edit','option:selected', this).remove();
});
$('.set_button').click(function() {
selected=$(this).val();
id=$(this).attr('id');
$('#opdots-bach-edit select.'+id).val(selected);
});
<input type="checkbox" name="employeeid[]" value="1870">
<input type="checkbox" name="employeeid[]" value="1874">
etc etc.
then here are my div buttons
echo '<div class="add_button" value="ssremployeeid[]">add</div>';
echo '<div class="remove_button" value="ssremployeeid[]">remove</div>';
echo '<div class="set_button" value="ssremployeeid[]">set</div>';