jquery-select2 Questions

7

Solved

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 its...

3

I am using the lastest version of Select2. Want to add an Insert New button at the end of the dropdown list. I tried these two solutions I found online Solution 1: $(".select2-drop").append('<...
Infinitive asked 11/2, 2016 at 14:56

6

I using select2 version 4 I try like this : $("select02").select2({ placeholder: "<i class='fa fa-sitemap'></i>Branch name", }); But, it's not working Demo is like this : http://...
Teilo asked 23/5, 2016 at 8:37

3

Solved

Please note that this is not about <select> element with multiple attribute, but multiple <select>s in a form, which I haven't found asked here. See this codepen I have two <select...
Him asked 25/1, 2016 at 10:37

2

I've downloaded select2 as node module by: npm install select2 and included it in my app.js: require('select2')($); When I run webpack there are no errors, but when I open the app I get: Un...
Dees asked 23/12, 2016 at 9:54

2

Solved

I have a select2 with a list of countries with their flag. To display the select, shows the flag and the country, but the selected text does not display the flag. This is the code: $("#cmbI...
Waddington asked 13/12, 2018 at 8:34

9

Solved

how can I get value of unselected option in Select2 using select2:unselect $('#mySelect').on("select2:unselect", function(e){ var unselected_value = $('#mySelect').val(); // using this shows 'nu...
Warr asked 25/12, 2015 at 14:32

18

I have a Select2 element on a page that loads results via ajax. Would like to test this with capybara/rspec (using the poltergeist driver), but since the Select2 element actually starts out as a hi...
Frankfort asked 7/10, 2012 at 18:12

6

Solved

I have a native <select>-element based on which I'm initializing a select2-dropdown-menu. I bound a change-event via select2 which is called whenever the select2/select-option is changed. How...
Grayback asked 10/5, 2013 at 15:59

3

Solved

So, I have this HTML code: <input type="checkbox" id="orders_lives_in_ccs" name="orders[lives_in_ccs]" class="lives_in_ccs"> <select id="orders_shipping_from" name="orders[shipping_from]"...
Everywhere asked 13/10, 2014 at 19:3

4

Solved

I need to be able to add a search box to my multi-select fields using select2. For whatever reason, while search boxes appear as expected in single-select fields, the same select2() call on a mult...
Yawata asked 23/3, 2016 at 20:44

8

I want to change the placeholder on a select2 enhancing control upon an event. So I've got this... <select id="myFoo" placeholder="Fight some foo..."> ...which is then enhanced: init: fu...
Gerger asked 3/6, 2013 at 17:16

3

Solved

I am using select2. So it is not a real number input field I try to create an input field that allows only numeric with decimal: <input type="text" name="numeric" class='select2 allownumericwit...
Tarpeia asked 11/10, 2019 at 11:23

5

Solved

I'mm using https://select2.github.io/examples.html but I don't want the border radius. How can I remove border radius to make the search box as well as the sliding area ?
Fiendish asked 29/4, 2015 at 12:55

8

Solved

I am using select2 with custom data adapter. All of the data provided to select2 is generated locally in web page (so no need to use ajax). As query method can generate a lot of results (about 5k) ...
Epiphenomenon asked 24/9, 2015 at 8:24

4

Solved

I using select2 to select and ajax to load data, how can I replace old data when the state is changed after initial selection. My loading code: $('.datetimepicker').on("changeDate", function() { ...
Subsequent asked 23/1, 2016 at 10:23

3

Solved

When user selects many items (tags), they are automatically sorted alphabetically. How to prevent automatic sort and keep user's order using Select2 4.0? Update: The mentioned "possible dublicate...
Crossfertilization asked 15/7, 2015 at 13:2

3

I'm trying setup data attributes into select2 options but without success, at this moment i have the following JS code _properties.$localElement.select2({ ajax: { url: "url", type: "POST", dat...
Exemplification asked 15/9, 2016 at 15:43

2

I'm trying to customize the widget rendered by autocomplete_fields for a ForeignKey Model field. Basically the problem is that the widget is too narrow for the content and it's breaking in two line...
Gracielagracile asked 8/5, 2020 at 12:37

3

Solved

I have a select element with select2 plugin. Version is 4.0. It works well but i cant change disabled option dynamically. $('#list1').select2({ theme: "bootstrap", disabled: true, placeholder:...
Curule asked 17/11, 2017 at 13:42

3

Solved

In a form there are multiple select2 elements. In a particular select2 element I set some options with a not null string 'text' and null 'value'. The submit form seems to behave like this: if 'va...
Annadiane asked 3/7, 2017 at 16:18

2

Solved

Select2 supports disabled options when it is initialized on a <select> tag, as discussed in this issue However, I can't find how to achieve the same result with remote data. Do I need to use...
Phia asked 14/8, 2013 at 11:30

14

I'm using the Select2 plugin from http://ivaynberg.github.io/select2/select2-latest.html what works fine but i'm having a problem to get the values from the options attributes. I've got a select m...
Jeraldinejeralee asked 3/10, 2013 at 9:13

4

Solved

There is help online for using select2 with capybara (see links below), but no help in particular as far as I have seen for select2 drop-down fields. I have tried all kinds of things, including try...
Higgins asked 21/12, 2016 at 7:39

4

I am currently unable to tab into a Select2 enabled <select> element in Firefox (38.0.5) - in other words, cannot access to select <option> in a mouseless manner. In Chrome, you can tab...
Shabbygenteel asked 3/6, 2015 at 21:19

© 2022 - 2024 — McMap. All rights reserved.