#### Category : jquery-select2

I am trying to use jQuery Select2 in Laravel Vue. But I have an error below when I use my base url. But, when I use another API service like https://countriesnow.space/api/v0.1/countries/population/cities, it’s okey, data can be retrieved. What’s wrong? I’ve been trying to solve this problem but nothing is gonna work. Access to XMLHttpRequest at ..

I’ve created a function that returns a json of products data, and I’ve wanted to display it in select2 in an infinite scroll way. Right now, I can only display according to the number of paginated results. Here’s my controller: <?php namespace AppHttpControllers; use IlluminateHttpRequest; use IlluminateSupportStr; use AppModelsProduct; class ReceiveInventoryController extends Controller { public ..

I created a livewire component, in it I created a form with normal Input and multiple select with select2. I filled in the fields and selected the necessary options in select, all variables (from default input and default select) are sent except select2. Through ddd(); it shows that they are []. Through the console, I ..

Im having a trouble on how can I merge two v-for based on the province select2 selected. It redundant on every province I selected. The data that belongs to my city should not repeated itself. It should unique based on the first v-for. It really helps me a lot if anyone have an idea about ..

I have a select2 in a livewire component. Everything works fine but in my edit view, the selected options don’t show in the box is selected. When I open the dropdown they show as highlighted, so data is coming from the backend. Please check below codes and output screenshots, Thanks in advance for your kind ..

I have an array called a catalog that has a relationship with several stores. I get them with this command on controller. There are users they also have relationship with several stores. $stores =$user->store()->get(); $catalog =$user->catalog()->with(‘store’)->get(); return view(‘manager.catalogs.manage’, compact(‘stores’, ‘catalog’)); I want to make selection using select2 with multiple option. <select class="select2 form-control ..

I’m working on a B2B ordering app and was using simple select/dropdowns to provide products to order and adding additional lines with jquery as needed – all working perfectly. I’ve now changed the select to select2 to provide searching. The first item works correctly, but if you add an additional line, it provides the select2 ..

I inserted the select2 value in the database using multi-select drop down, but when I edit the modal it returns no value in the selected value. I am using jquery ajax with Laravel. Form <form id="userForm" name="userForm" class="form-horizontal" data-parsley-validate=""> <input type="hidden" name="user_id" id="user_id"> <div class="form-group"> <label for="email" class="col-sm-2 control-label">Project</label> <div class="col-sm-12"> <select id="project_id" name="project_id[]" class="selectpicker ..

I am building a CRM project with Laravel 8. I want to use select2 but there is something wrong. I can’t select after first select. It looks like this and I can’t select. HTML: <div class="form-row"> <div class="col-md-12"> <div class="position-relative "> <label for="gondericiAdi">Göndericinin Adı:</label> </div> <div class="input-group"> <select class="form-control" name="" style="width:100%;" id="gondericiAdi"> </select> </div> </div> ..

I use SELECT2 ( v4.0.13 ) into Laravel Livewire ( v2.4.4 ). And I want to use SELECT2 to fetch remote data with Laravel Livewire by typing some perms just like using the build-in ajax feature. But I can not use wire:model to bind any Livewire properties to the SELECT2 search input field. Any help ..

I use SELECT2 ( v4.0.13 ) into Laravel Livewire ( v2.4.4 ). And I want to use SELECT2 to fetch remote data with Laravel Livewire by typing some perms just like using the build-in ajax feature. But I can not use wire:model to bind any Livewire properties to the SELECT2 search input field. Any help ..

I am trying to add the default selected option to multiple select2 with remote data. But the title is set instead of the option text. This is my code: Html <select class="form-control select_medicines" id="select_medicines" name="medicines[]" multiple="multiple"> @foreach($medicines as$medicine) <option value="{{$medicine->id}}" selected="selected">{{$medicine->fa_name . "(" . $medicine->en_name . ")"}}</option> @endforeach </select> Js$(document).ready(function() { $(".select_medicines").select2({ ajax: .. Read more I’m learning Laravel framework and I wanted to add Select2 to my project with Laravel-mix. After many hours of trying to do that, I did it and everything seems to work fine, except one little, but very annoying issue. When I click on my <select>, the search input inside is not focused, so it looks .. Read more I am trying to insert multiple data to the database using Livewire and it’s like a I have class I need to add multiple students to my class table … what can i do for that because livewire not working with livewire Steps to Reproduce: Are you using the latest version of Livewire: Yes Do .. Read more I am using Livewire and Slect2 in my project and I am code to select 2 javascript also but select 2 value is not passed to the database here is my code My Blade File <div class="col-12 col-lg-12 col-sm-12"> <div wire:ignore> <div class="form-group"> <label for="exampleInputRounded0">Section Name</label> <div class="input-group"> <div class="input-group-prepend"> <span class="input-group-text"><i class="fas fa-globe-asia text-primary"></i></span> .. Read more I’m working with Laravel 8 and for the screen tests I’m using Dusk (https://laravel.com/docs/8.x/dusk). In one of the screens, i have a select2 with "tags" property enabled (https://select2.org/tagging), that allows you to create a new record if there is no option in select. I just cant the test "Create a new option for select2 with .. Read more I write HTML code in controller public function edit($id) { $user = User::find($id); $rolesForEdit = Role::pluck(‘name’, ‘name’)->all();$userRole = $user->roles->pluck(‘name’, ‘name’)->all();$html = ‘<div class="row"> <div class="col-md-6"> <label for="name">Name</label> <input value="’ . $user->name . ‘" class="form-control" placeholder="Full Name" type="text" name="name" id="name" /> <br> <label for="phone">Phone Number</label> <input value="’ .$user->phone . ‘" class="form-control" placeholder="Phone Number" ..

I have a select2 in a livewire component. Everything works fine but in my edit view, the selected options dont show in the box as selected. When I open the dropdown they show as highlighted, so data is coming from backend. <div wire:ignore class="col-8"> <select wire:model="notificationType" class="form-control select2 text-sm" multiple="multiple"> @foreach($notificationTypeOptions as$key => $option) .. Read more I have a small problem. I have a Select2 multiselect field in my edit form. Now my goal is that my script loads all options and that the correct options are preselected. I have already tried the whole thing, but so far it has not led to the desired result Here is my Code Controller .. Read more I am working on Laravel Framework using Vuejs as the forntend javascript framework. In the vue component there is already a select element which I need to replace with select2 ajax search. I am using the vue-select in my project. There is no document on how to use it with ajax. Please help me with .. Read more want to add select2 in select which is created from controller. i added dropdownparent but not worked. `In contact.blade.php Sourc.. Read more I’m using select2 plugin in Laravel form: <select id="productTags" class="form-control mt-2 select2-hidden-accessible" tabindex="-1" multiple="multiple" name="productTags" data-select2-id="productTags"> <option value="adidas">adidas</option> <option value="asics-tiger" data-select2-id="7">asics-tiger</option> <option value="autumn" data-select2-id="8">autumn</option> <option value="backpack">backpack</option> <option value="cap">cap</option> <option value="converse">converse</option> <option value="drmartens">drmartens</option> </select> <select id="productVendors" class="form-control mt-2 select2-hidden-accessible" tabindex="-1" multiple="multiple" name="productVendors" data-select2-id="productVendors"> <option value="ADIDAS">ADIDAS</option> <option value="ASICS TIGER">ASICS TIGER</option> <option value="CONVERSE">CONVERSE</option> <option value="DR MARTENS" data-select2-id="12">DR MARTENS</option> .. Read more I am currently using select2 with a Laravel project like this: Html: <div class="row"> <select class="offices" name="offices"></select> </div> JS:$(".offices").select2({ ajax: { url: "{{route(‘site.addresses’)}}", type: "post", dataType: ‘json’, data: function (params) { return { _token: @json(csrf_token()), searchTerm: params.term }; }, processResults: function (response) { return { results: response }; }, cache: true } }); How ..