508 questions
0
votes
0
answers
38
views
Search not working for select2 with custom data on a modal
I'm using Select2 4.0.5 with bracket plus bootstrap 4. Its working fine so far with my customData. I tried creating a test select element outside the modal with my current setup for initialization and ...
0
votes
0
answers
17
views
Using a ListBoxFor with Select2
I've setup Select2 in a form to create a list of strings. It also allows me to search and create my own items.
@Html.ListBoxFor(model => model.Schemas, new SelectList(Model.Schemas, "", &...
-1
votes
1
answer
57
views
Select2 not display the value of the option selected
I have used an ajax request using laravel api. In this i select a boat on basis of which its accessories ccomes up with categories and sub categoreis and then the accessory to be selected. The ...
0
votes
1
answer
199
views
select2 troubles with positioning in lightbox modal [closed]
Using Select2 4.1, jQuery 3.7
When I show the select2 in a modal/lightbox, it does not position the dropdown correctly. When the select is clicked, it should show the dropdown directly above or below ...
0
votes
1
answer
275
views
Populate 2nd Select2 from Selections on 1st Select2 with AJAX and OptGroup
I have my first select2 that I pull data into from remote ajax search with multiple options allowed:
$("#EmailSentToGroup").select2({
ajax: {
url: "/trip-search",
...
1
vote
0
answers
58
views
Using select2.full in typescript from npm
How can I import the select2.full in typecript?
I installed the package with npm. But when importing I only get the parameters from select2.min.
Is there a way I can still use select2.full?
0
votes
1
answer
66
views
Select2 - Item not rendered after Ajax Selection
I setup a Select2 Object to work wit han ajax source data.
This is the Html
<select class="form-control" id="customerSelect" style="width: 200px !important;"></...
1
vote
2
answers
595
views
Implementing multi-select with search in a Tabulator.js column
I am currently working with Tabulator.js and trying to create a column that has a multi-select feature with a search option. I've attempted to implement this using the Select2 library, but I'm running ...
-1
votes
1
answer
225
views
How to Efficiently Manage Large Datasets in Select2 with AJAX and Laravel
I'm working on a Laravel application that requires dynamic loading of select options in the UI, potentially dealing with large datasets. The goal is to implement autocomplete functionality where ...
0
votes
0
answers
88
views
Put link (anchor) in select2 "no results" dropdown message
When using select2, is there any way I can put a link in the "No results found" message? Meaning, the message that shows up when someone types in the select2, but there's no matching item. ...
1
vote
1
answer
217
views
Style select options in Select2
The problem is how to apply a style on a part of an option.
I have a SELECT like this:
<select id="my_select">
<option value="1">Item 1 <span class="color-...
0
votes
1
answer
502
views
HTML jquery Select2 issue in which selected value is not showing properly
I have integrated Select2 plugin into my project which is working as good as I wanted. But I'm still facing small issues like whenever I scroll down and selected the last value on the select2 options ...
0
votes
1
answer
144
views
Enable to add anchor link in dropdown option in select2 Version 4.0.x
I need to add the link tag inside the dropdown options tag,
I've already found the blogs, but it only works with 3.x.x version.
How do I make a link open in an option
https://forums.select2.org/t/how-...
0
votes
1
answer
194
views
Preselecting option in an remotely sourced (AJAX) Select2
I am trying to preselect an option in select2 from a remotely sourced select2 control. I am trying to follow the documentation
Preselecting options in an remotely-sourced (AJAX) Select2
I have an ...
1
vote
1
answer
138
views
Display select2 ajax results into template
I have select2 displaying data after making an ajax call.
<script>
$(document).ready(function () {
$("#citySelect").select2({
theme: 'bootstrap-5',
...
1
vote
2
answers
1k
views
select2 multi group select. Select parent, disable child nodes. Unselect parent, enable child nodes
I have implemented 2 custom functions with select2:
Select parent node, add parent node to selected and disable child nodes.
Unselect parent node, remove from selected and enable child nodes.
This ...
0
votes
1
answer
492
views
Clear Select2 Search Input When No Results Found
I am using jQuery Select2 version 4.0.13.
I would like to auto clear the search text box when the No Results Found displays.
Sort of a reset of the dropdown options.
Currently I use scanned barcodes ...
0
votes
2
answers
3k
views
livewire 3 and laravel using select 2 window.livewire.on('data-change-event',()=>{ expression statement is not assignment or call
I am trying to use select2 with livewire 3 in laravel 10.
But when I am trying to write a script in resources/views/layouts/app.blade.php, it is showing the below error ,
"()=> expression ...
0
votes
2
answers
67
views
JavaScript new Table row Class not applying
In my web application, There is a table and Add button.
Whenever the user clicks on the Add button, from javascript, I load the new row to the table.
In the row, there is a element and for that class,...
1
vote
0
answers
261
views
Select2 Bottom of placeholder text is getting cut off
The bottom of the placeholder text on this Select2 multiple select is getting cut-off, how can I edit the CSS classes of this input to stop this from happening.
Here is my current code:
<style>
...
0
votes
1
answer
882
views
Clone select2 element in current version (4.0.13)
The essence of what I’m trying to do is already asked & answered here in this SO question. That question includes a fiddle and code that works in an prior release of select2 (v3.3.2), but does not ...
1
vote
0
answers
238
views
How to preselect options when using select2 multiple select box with an ajax data source
I have a table in a form in a flask app with a select2 multiple select dropdown in each row of the table. In the table in the template file I have:
<select name="visible_bonuses[{{ country.id }...
0
votes
1
answer
122
views
Select2 selecting same index with external data source doesn't trigger change event
Using select2 version 4.0.10.
My datasource is returning the data I expect.
The select2 is a single select. Re-selecting the data wouldn't be harmful.
I presume this is a problem with the external ...
1
vote
1
answer
2k
views
How to include a label in jQuery Select2?
I've set up a Select2 instance that queries my database and renders the results via AJAX on an input that the user has access to.
Everything is working but as this is a location selection input for a ...
0
votes
0
answers
54
views
How can I implement a dropdown with 100 default options and the ability to search and retrieve additional options from database using AJAX in Select2?
I have 100 options on a select/dropdown and more in the database. Users will select option if available in the dropdown. If not, then the user will search and an ajax will call to get others from ...
0
votes
0
answers
77
views
How to make Multiple dependent dropdown in CRUD Django?
Fields are such as;
Phone Name(Field1)
Samsung
Redmi
Phone Model(Field2)
M30
Note10
Note : Dependency between Phone Name and Phone Model(if select samsung from the dropdown then M30 should comes and ...
0
votes
0
answers
70
views
Select2 doesn't select option
I use select2 with AJAX data source. It shows the options, but when I choose one, it doesn't show/select the label. It keeps showing empty or the placeholder.
HTML
<input name="organization&...
0
votes
1
answer
748
views
Select 2 focus on search on click/tab without unique ID
I am using Select 2 4.0.13 on jQuery 3.6.1 and am looking for a way to allow the search bar to be selected when the Select 2 is opened.
I found https://stackoverflow.com/a/67691578/1278201 which does ...
0
votes
0
answers
662
views
Select2 not displaying the select box
I have a problem with the Select2 plugin's last version, I don't know why the select box isn't showing up. I'm using Bootstrap 5.1.3, JQuery 3.6.1, Select2 4.1.0rc
JavaScript:
const locationSelect = $(...
0
votes
1
answer
398
views
Cant change title for tooltip in select2 selected options
$(document).ready(function() {
$('.reminder-numbers-select').select2({
tags: true,
dir: "rtl",
dropdownAutoWidth: true,
width: '100%',
})
});
#rem-no {
width: 100%;
}
<link ...
0
votes
1
answer
257
views
How to set value programmatically to Select2 jQuery & ASP .Net Core
I'm working on a ASP .Net Core project where for the first time I'm using Select2.
I have one page where I'm passing the ID's that I need by ViewModel like this:
Controller:
public async Task<...
1
vote
0
answers
288
views
How to display selected multiple dropdown values in select2 jquery laravel8
i have 3 tables dealer_master,distributor_master,dsdl_master. In dsdl_master table dealer specific distributor has been saved.
I have getting all the distributor list. using dsdl_master table i'm ...
0
votes
1
answer
247
views
How To Get Data From Api And Display It To Related Control In Dynamic Table When User Select An Item From Select2 In Laravel?
How To Get Data From Api And Display It To Related Control In Dynamic Table When User Select An Item From Select2 In Laravel?
I am using Laravel with select2. In my form I am adding select2 and input-...
0
votes
1
answer
436
views
Dynamic Select2 Item Automatically Cleared When New Select2 Is Added In Form?
I am using Laravel with select2. In my form i am adding select2 dynamically and getting select2 data from server using ajax request and its working fine. But Problem is...
When I select an item from ...
0
votes
1
answer
1k
views
select2 - "trigger" does not fire
When I open the drop-down the value I set via jQuery is highlighted but doesn't get triggered/selected. Clicking on the highlighted option also doesn't do anything until I click the other option and ...
1
vote
1
answer
662
views
Select2 dropdown is not adding classes to its dropdown items from original options
Select2 is not adding the classes to its dropdown items from the options
Suppose in the below dropdown code, attribute class="highlight" was added to few options to highlight those with some ...
0
votes
1
answer
44
views
How to modify select2 serach box text on keyup?
I'm trying to change the text of select2 search box on keyup event.
Suppose whenever we will write a Bangla digit it will automatically convert into an English digit
<div class="form-group col-...
2
votes
1
answer
3k
views
select2 not displaying selected value text added programatically
I have a dropdown created with select2 (v4.0.13 and I can not change it) using AJAX requests on a form where the user can search for things. The page is built with Thymeleaf and when the view is ...
0
votes
1
answer
932
views
How can I select children options from optgroup in Select2?
Question:
I have successfully created a select2 template with a group but I can't select the items in it, is there anything missing from the code I made below? Any help from you means a lot to me, ...
1
vote
2
answers
507
views
modal form validation after using select2
I am using partialview in modal form. In this form there is a select2 option list which working fine. But when press submit button, required fields as per model are not validating i.e. not showing ...
0
votes
1
answer
183
views
Search a word in select2
I have an ajax result as follow:
{
"data": [
{
"id": "AABB",
"text": "AABB"
},
{
"id": "BBCC",
...
3
votes
1
answer
8k
views
Select2 li - aria-selected=true is not read as selected by screen reader
I am currently using select2.js version 4.0 and having this issue where screen reader (NVDA) won't read the selected option, even aria-selected="true" is added correctly to the current ...
1
vote
1
answer
3k
views
Select2 - multiple inputs with select 2 shares the same options when one of them is selected - BUGG
I am facing a strange problem with the Select2 library. I have added a few select html elements with different options specified for each tag. Each select is decorated with:
<select id="...
1
vote
1
answer
2k
views
How to prevent select2 to call select2:close the second time when selectOnClose is set to true?
I am using Select2 V. 4.0.10
I want to have a select2 that behaves the same way when you select using the Enter key and the Tab key.
What happens is that when selecting using the Tab key, the close ...
0
votes
2
answers
533
views
Can't pre-select options in Select2 multiple choice select box
I use the select2 jQuery module to create a multiple choice select box. I did this in an early version (3.4.5) and it worked fine. But after upgrade to 4.1.0 pre-selection of an option does not work.
...
2
votes
1
answer
885
views
How to display exact value from drop down?
I have configured my select via select2 and things works quite well.
I have used templateResult with formatState approach to add the icon to my dropdown options.
$(".js-country-list")....
0
votes
1
answer
848
views
Select2 filter with separate strings
Cannot find anything on here or https://select2.org/
Is it possible using select2 to filter results with separate strings?
Example:
Options
Phone Brand 128GB A Silver
Phone Brand 256GB A Black
Phone ...
1
vote
1
answer
5k
views
jQuery.Deferred exception: Cannot read properties of undefined (reading 'length') -> Laravel 8 Boilerplate + Bootstrap
I am using Laravel Boilerplate from Sebastien Heyd and trying to get Select2 options via Ajax. When I click on the select element after the page loads, I get the error:
jQuery.Deferred exception: ...
-1
votes
1
answer
736
views
Filter GridView with Multiple 'DropDownList with Multi-Select' using jQuery Select2
I'm trying to Filter GridView with Multiple 'DropDownList with Multi-Select' using jQuery Select2.
I'm following the codes from this link >> https://www.aspsnippets.com/questions/182622/Filter-...
0
votes
1
answer
626
views
Select2 v4.1 - search not updating correctly?
I'm currently using JQuery and Select2 within a webapp at work, I have some experience of using JQuery but this is my first time using Select2. Whilst I can't share the actual project code, I have ...