Option doesn't update


#1

Hello,

I have a form with many select2 fields. There is a problem with one particular field. When the value is updated to ‘0’ the old option still stands there and is not updated as well. This is the code:

<select2 class="select2_tag form-control" name="ma_id" id="ma_id" v-model="mailingsID" >
        <option value="0" selected="selected"></option>
        <option value="15291">Cisco Mastertemplate Beispielmailing</option>
</select2>

watch:{
    eventInputStore: function () {
            if(this.eventInputStore=='')
            {
                this.feldSichtbar='none';
                document.getElementById('ma_id').value=0;
            }
            else
            {
                document.getElementById('ma_id').value=0;
            }
}

Can someone tell me what the problem is?
Thanks!


#2

I found a solution:
I just added
$('#mySelect2').val(null).trigger('change');