select2 in modal not work
//replace it with your script
<script>
$('#mySelect2').select2({
dropdownParent: $('#myModal')
});
</script>
select2 in modal not work
//replace it with your script
<script>
$('#mySelect2').select2({
dropdownParent: $('#myModal')
});
</script>
select2 with livewire
<div class="form-group col-md-3">
<label class="text-sm"for="division_id">Division</label>
<select class="form-control select2 {{ $errors->has('division_id') ? 'is-invalid' : '' }}"
wire:model="division_id" id="division_id" >
<option value=''>{{ trans('global.pleaseSelect') }}</option>
@foreach($divisions as $id => $division)
<option value="{{ $id }}" {{ old('division_id') == $id ? 'selected' : '' }}> {{ $division->division }} </option>
@endforeach
</select>
</div>
<script>
document.addEventListener('livewire:load', function () {
$('#division_id').on('select2:select', function (e) {
@this.set('division_id', e.target.value);
});
});
</script>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us