Newest 'jquery-select2' Questions

Q&A for professional and enthusiast programmers

How to Disable select 2 js selected values on second select box

i got two select boxes both using select2 js, on the first one you can choose just one value, and on second you can choose multiple values, so what i want is to make this stuff work like this - if i ...

Bulma css with select2 jquery plugin

I tried to implement select2 plugin using the Bulma css framework but it seems messy in frontend. I tried this using bootstrap and yes there's no problem since select2 has a bootstrap compatibility. ...

select2 placeholder issue with template

I have created a select options with select and it's data source is js object Problem is when i am using template to add some data with the select option, the placeholder also getting that data with ...

select2 is not a function

I have this html <div class="input-box"> <select id="billing:country_id" class="validate-select" name="billing[country_id]" title="Country"> <option value=""> &...

How to change the default tagging behaviour of select2?

Iam trying to implement selectAll functionality with select2. I modified my select2 implementation by using custom dropdown adapter by following this implementation http://jsbin.com/seqonozasu/1/...

select2 multiple field only with search

I have a multiple select list $("#myField").select2(); that works fine. I get the values from the database and with a foreach loop i add all the options to the list. I want to ask if there is any ...

jQuery select2 with “Loading remote data” approach- Get values in the order they were selected

I'm developing a form with a number of multiselection dropdowns. It has around more than 10thound records. So, I used Select2 library with "Loading remote data" approach for that. The problem is that ...

Adding custom tags style in Select2 MultiSelect Dropdown

so I'm using Select2 4 library (https://select2.github.io/) and I have a problem. <select id="test" multiple style="width:800px;"> <option value="a">aaaaa</option> <...

How can I make RobotFramework interact with Select2/JQuery elements?

I can't seem to figure out how to gather xpath or Id values from Select2 elements. I'm currently using Select2 to manage and populate drop-down lists and text boxes. I can only seem to get the locator ...

static and dynamically added select2 conflicts

I have a form with a select that i uses as a select2 $(document).ready(function() { $('select').select2(); }); The form with this select2 contains more dom elements, and can be cloned with an ...

Does eq: actually evaluate a string for variable values?

This one is stumping me. Maybe I don't see it, so someone please help me out. I am using select2 and trying to set the select option box with a programmatically determined default value. This value ...

Select2 keep loading after filter YII2

thank for reading. I have some problem with select2 - filter gridview Yii2: Yii2 render select2 when i load page: enter image description here so it worked, data was filled, but select2 keep ...

select2 inside render method of a backbone view

I've a Backbone view which is expected to render a select input using Select2. Select2Cell = Backbone.View.extend({ tagName: "select", initialize: function(options) { this.data = ...

Performance about Select2 library when using large data sets

My question is about performance of Select2 extension when using large data sets. I've more than 9000 options in select.I don't want to use ajax calls to fetch them. At this moment it's like takes 2-3 ...

Select2: Incorrect option selected by default

The issue location regarding question: https://xtee.radr.eu How to fix the second select box (Select Subsystem) that it wouldn't have the first option selected? Currently it will select ...

How to repopulate select2 field on edit form

this select2 field isn't repopulating with the data when I'm using the same partial and form for editing the instance. I've been researching it for a while without coming up with a solution. It's ...

laravel 5.4 select2 multiple edit

I don't know how to populate the edit function my select2 form. Here's my attempt on doing it. Controller: public function edit($id) { $company = Company::find($id); $categories = ...

Select2 - limit number of options

I am using select2 select2.github.io As of now i am fetching option values from db and successfully i can see the options in the dropdown which on typing gets filtered. Expected: In case if my ...

Add Multiple Values from select2 dropdown into CodeIgniter database

What I Need: When User selects Multiple Values from Dropdown in select2 which are given as option values, All the values must be stored in a table named companies, each input will have its own column ...

Use select2 with JSON file data

I have a .JSON file with some school subjects that have courses in them. Every subject has a code and a name attribute. Some of them have these courses that are code and name pairs in a array in the ...

Update select2 values

How would I approach updating the values of a select2 drop-down? I've looked here already and nothing I tested did updated the replaced the data in the drop-down. - Update select2 data without ...

how to apply select2 in Yii2 dropdown list

In yii2 basic ActiveForm i have added a drop-down list and in it used the "options" array to add my attributes .i want to add select2 in my drop-down but it is not working .i have searched on web and ...

select2 bootstrap plugin for arabic not working proper

> Hi all I am working on select2 bootstrap for Arabic website, but it's not aligning right to left, is there any option to change the direction of option list.

React addEventListener not working with select2 events

Here is the situation: I have a Ruby on Rails site that has a view that uses select2 and ajax to populate a select list. I am in the process of rewriting the view to use React.js. When a user selects ...

Already selected options which are disabled should not give to remove in select 2

Is there an option to block 'remove option' (or hide remove button) from tags which are already selected and disabled. Here is my code in jsfiddle. https://jsfiddle.net/wphqwvLf/734/ <select id="...

Implode Multiple values from Select2 form and Insert to database in CodeIgniter

I am using multiple select from a select2 dropdown and I want to store all the multiple values selected from the form in database "xyz" tablename='pp_companies' row="category1" <-- Need this ...

yii2 select2 gridview filter searchmodel

I'm trying to filter a yii2 gridview with a select2 In ModelSearch I have ->andFilterWhere(['like', 't_persons.functions', $this->functions ]) Unfortunately string (1) matches 10 and 11 as ...

Django - implementation of select2 with url

I've added a select2 field to my webpage and I want to load the records into it using ajax. So I've declared a url field. $(document).ready(function() { $("#field_id").select2({ ...

JQuery select2 function not showing the array object in tag section

I am using "select2 Jquery" script for multiple tags selection. I am passing an array of objects from another file, those values are not displayed in drop down. But If I manually test with another ...

Select2 search highlights results based on option value

I'm using Select2 to let the user select among a list of email addresses. The option value is the actual email address, while the option html display the full name (and again the email address). <...

Datatables with scrollY and select2

Select2 work fine until user select option and fire render() method. Then you cant close select by clicking another or clicking around area (body). Console return Cannot read property 'select2' of ...

Select2 show more values

I created select2 drop-down. Now I want to add description, city, shop, etc. in this drop-down show by country name. How can I add country city name, area, shop etc? (function($) { $(...

Value of the selected option is not saved in the collection aldeed:autoform-select2 Meteor

I created a field of a schema (CollectionTest) as follows. year: { type: String, label: "Year", autoform:{ type:'select2', options:function () { ...

Text cut-off with Select2 and Bootstrap

I'm currently having an issue with a form that uses Select2 to make a selection look nicer (and more functional) in combination with a bootstrap layout. The issue is that the longest element(s) of a ...

Jquery 1.6.1 issue with select2 [duplicate]

I used in my project JQuery 1.6.1 library, but right now I want to use select2 plugin with JQuery 2.0.0 for my all my select boxes and this makes some errors with some Jquery function like $().live ...

how to restrict manual creation of tags in CKAN

how to restrict manual creation of tags in CKAN. currently user can search existing tags and also add a new tag.

Retrieving JSON from server using Select2

I am trying to create a drop-down list using Select2 and JSON data from a server. I attempted to follow their example and it works but I am having a hard time completing it. I use the code below to ...

dose select2 support custom data-attr mapping

I am filling select2 input remotely by ajax $.getJSON(DataLink, function (data) { $('#select').select2({ data: $.map(data.data, function (obj) { return {id: obj.id,...

Add selected options to Select2

I'm using Select2 in "Ajax mode" so I get the options from an API endpoint. But I need to prefill it with some selected options via Javascript after the user starts to type. I've try to append it to ...

Jquery Select .prepend(“<option></option>”) not working

The problem i am having is loading a select box and showing the placeholder when nothing is selected. Using select2 (4.0.1) works only if i set as "multiple" {!! Form::select('meals_list', $meals, $...

select2 use keyboard to select items

I am using select2 v4 but I cant find a way to make the select works with keyboard keys (UP, Down) I cant make the select to work using the keyboard, $(".js-data-example-ajax").select2({ ...

Select2 selecting random option with jquery

<tr class="form-row form-row-odd form-row-err form-cols-2 form_element_company_id"> <th>Company&nbsp;<span class="required">*</span></th> ...

Yii2 : Dropdownlist

I'm trying to create A Point of sale in YII2 so i need to create a select2 for items search in sales page , i need it to search between to tables items , Bar_code i made it in tow tables because there ...

Setting initial value for select2 with ajax data source

I use select2 for specifying recipients for the website's inner messaging system. There are users and they can send messages to each other. They can search other users by the user name. I use the ...

how to set maximumSelectionLength to 0 in select 2

I am using select2 select box . Now i want to limit the maximumSelectionLength of the box to 0 based on some this condition . (targetingTypeConfig.name === 'States' && this.model.get('...
Translating... 0%