I have a registration form where I reset the fields when entering a record with the following:
document.getElementById(id).reset(); //Aqui passo o id do formulário
The problem is that I now have a select2 multiselect that are not being reset.
<select name="funcao_id" class="form-control select2">
...
<option>...</option>
...
</select>
<select multiple id="exames" name="exames[]" class="form-control">
...
<option>...</option>
...
</select>
<script>
$(function () { $(".select2").select2(); });
</script>
I put only the relevant parts of the code, if need be I put something else.