Removing value from Array after Unchecking with Multiple Checkbox's
<pre><code>$('.options').click(function() {
            var selectedItems = new Array();
            $("input:checkbox:checked").each(function() {selectedItems.push($(this).val());});
                var data = selectedItems.join(',');
            $("#opts").val(data);
        });
</code></pre>

<p>I have this function inserting the values from a checkbox into an array. Currently that works fine. But upon submitting the form the value stays in the array like it should but the issue is that upon unchecking the checkbox it stays within the array, and if I check the same box again it adds the value again. Any help?</p>
