Questions tagged [jquery-select2-3]

Select2 4.0 was released in March 2014 and is a complete rewrite of the Select2 code base. Please only use this tag for 3.5.x versions of Select2.

Select2 4.0 was released in March 2014 and is a complete from-scratch rewrite of the code base.

This tag is for 3.5.x versions of Select2.

Make sure to also tag the question with .

26 questions
73
votes
7 answers

Select2 Ajax Method Not Selecting

Ok, I'm sure there's something simple set wrong here but I'm not 100% what it is. So I am trying to use Select2 AJAX method as a way of users to search a database and select a result. The call itself is coming back with results, however it will not…
AlbertEngelB
  • 16,016
  • 15
  • 66
  • 93
16
votes
3 answers

Select2 use a dynamic Ajax URL on call

I use the Select2 plugin (v 3.5.2) with Ajax to dynamically load elements in the list. I have an issue as between the initialization of the Select2 (where a url property is set in the ajax helper) and the time the ajax call is made, this url might…
Pascal Luxain
  • 271
  • 1
  • 4
  • 11
10
votes
2 answers

Chrome is autofilling my select2 input with its placeholder

I'm currently experiencing a very annoying problem with Google Chrome. I have some filters that are a multi-select and when I click to type on those filters, chrome suggests as an autofill option the placeholder for that select. I've never typed…
9
votes
5 answers

Select2 apply bootstrap input-lg

How can I implement input-lg class in a select2 dropdown? I wan't my dropdown to have the same size as an input element having a class of input-lg here's what I have so far
9
votes
1 answer

maximumSelectionSize isn't working in Select2

I have a multivalue select, and I want to set the restriction on number of selected items using the select2 library. Documentation says that I should set maximumSelectionSize during the object initialization. Unfortunately, the following code…
8
votes
1 answer

Is there a way to add a description to each option in a dropdown using select2?

I have a Django project in which I have a select dropdown like this: But I want something like this: My
5
votes
1 answer

Select2 4.0 - Keypress does not trigger selection

I've upgraded Select2 from version 3.5.2 to version 4.0. We have plenty of forms with many fields filled in by typists. In the old version (3.5.2) the typists would use the following sequence: Focus on the element Type a number Press Tab to both…
Matanya
  • 6,233
  • 9
  • 47
  • 80
5
votes
1 answer

select2, ng-model and angular

Using jquery-select2 (not ui-select) and angular, I'm trying to set the value to the ng-model. I've tried using $watch and ng-change, but none seem to fire after selecting an item with select2. Unfortunately, I am using a purchased template and…
Noy
  • 1,258
  • 2
  • 11
  • 28
4
votes
5 answers

jquery-select2 obtaining ID and text from a select box?

I'm using the jquery-select2 plugin, and I have the following field that is being autopopulated by AJAX: Here is the javascript: $('#player2').select2({ placeholder: "Select an…
bo_knows
  • 856
  • 2
  • 9
  • 20
3
votes
2 answers

Hide virtual keyboard after selecting value on Select2 v3

I'm using select2 v.3.4.5 solely for my project. Currently, when viewing on mobile, the keyboard does not close after it open and value selected, I would like to close it thought. I would like open only when user focus on it and type…
Houy Narun
  • 1,557
  • 5
  • 37
  • 86
3
votes
0 answers

Changing data-attribute on select2

I working on an older legacy system using select2 3.5.2. It's using the older hidden field method, and it currently passes data like so:
Ian Jamieson
  • 169
  • 10
2
votes
1 answer

Aurelia Select2, load remote data not loading next page

I'm trying to use Select2 and load remote data (ajax) in Aurelia. So I create a custom attribute called Select2 and follow the options in the documentation. But, I faced an issue when I scroll to the end of the drop down a "loading more results"…
2
votes
1 answer

Unable to bind event to .select2-search-choice-close

I have connected select-2 plugin to my select element and now I would like to assign one event to it: to reload the form after clicking .select2-search-choice-close, but I'm unable to bind any event to this element. Before binding the event I have…
van_folmert
  • 4,257
  • 10
  • 44
  • 89
2
votes
1 answer

select2 multiple versions on same page/site

Afternoon, On a website I already updated lots of elements that used select2 v. 3.5.2 to the new v. 4.0 (and some of those elements are on the header of the website that is present on ALL pages) Unfortunately on some pages of the website the…
1
vote
0 answers

How to get list of options / data from an input-based select2 3.5 control

Were using 3.5.3, and have had no luck finding a way to do this. After I select2-enable an input box with an array of values (using data: in the consructor options), is there a way to get that list back again, from the drop-down in question? We have…
erk
  • 11
  • 2
1
2