0
I am at a slight impasse. Only one Select2 in my system is not working the search field. It makes the implementation of the plugin, however in the search field it does not allow entering the data. It is separated in a modal.Follows below the code snippet:
<div class="form-row">
<div class="form-group col-md-12">
<label>Advogado:</label><br/>
<select class="form-control selectDois" name="advogado"style="width: 300px; !important">
<option value="" selected="selected"></option>
@foreach($advogados as $advogado)
<option value="{{$advogado->id}}">{{$advogado->user->nome}}</option>
@endforeach
</select>
</div>
</div>
selectDois implector
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/js/select2.min.js"></script>
<script>
//select 2
$(document).ready(function() {
$('.selectDois').select2();
});
</script>
The idea is this... When I click on the button, it opens a modal to link a lawyer, however select two implements, but does not let insert anything in the search field....
and this modal is already loaded along with the page and appears later, or it is loaded only when an event happens (click, etc)?
– Ricardo Pontual
the modal is loaded together via @include('admin.modais.alterarAdvogado') and when the click event occurs it is activated. I tried to put the script in the modal file, but it still didn’t work.
– Betini O. Heleno