Most voted "jquery-select2" questions
Select2 is a jQuery-based substitute for select boxes. Supports search, remote data and infinite scroll of results.
Learn more…66 questions
Sort by count of
-
6
votes4
answers9080
viewsSelect2 with AJAX
For some reason my Select2 using AJAX to fill it is not working. When I put a Debugger in the code, it does not enter the method result: and also returns no error. HTML: <input type="hidden"…
-
5
votes2
answers1005
viewsWhen selecting option displays div with
I have a doubt, as I know nothing of PHP, i would like someone to help me how to assemble or implement a Jquery that I found. In my case there are 2 selects, one who would be called Estado and…
-
5
votes1
answer69
viewsRelation between selects
I have a system that has 3 selects, where selecting an option in the 1st select is listed a list in the 2nd select and selecting an option in the 2nd select, is listed the items in the 3rd. The…
-
4
votes1
answer1941
viewsPerform mathematical calculations with values from a dynamic table
I have a form-Wizard table that as soon as I click on "add item" I call a function and it adds a row in the table to add a new item to be purchased by the customer. This table that at each click…
-
4
votes1
answer605
viewsSearch for the option title using select2
I have a select element and I need to search the items (options) not only for the text, but also for the title (or any other attribute), I have already been able to put the title to appear when…
-
3
votes2
answers538
viewsRemove Select2 parameters
I have a problem using the Select2 plugin, I need to make an AJAX request, but I need the final URL to be the following: api/user/findbyname/name And the way it’s coming is this:…
-
3
votes1
answer9617
viewsHow to concatenate an input name with a jQuery variable?
I own a table that contains a button that adds a row to the table each time I click on it. The created line has 4 inputs, one of these inputs has an auto-Suggest / auto-complete function that…
-
3
votes2
answers1462
viewsBug when using Select2 in a Bootstrap form-group
I’m having a hard time fixing a bug that happens when using Select2 in a input-group. The problem is that when selecting a option with a very long name, the input-group does not respect the width of…
-
3
votes3
answers43
viewshow to execute a specific button on a list of 5 identical buttons
I’m doing a user-friendly Dashboard and I need a button to edit. When the edit button runs it just makes code appear and disappear, but wanted to know if it is possible to execute jQuery code and…
-
3
votes2
answers39
viewsProblems cloning a field using Jquery
I am trying to clone an object using Jquery, but the width of the cloned field is not as expected. HTML <table class="table table-responsive" id="tableAulas"> <thead> <tr>…
-
2
votes1
answer810
viewsValue as Object when selecting item in Select2
The Select2 plugin works normally, the only problem is when I select the item the value put in hidden (mandatory to bring data via AJAX) is as [Object Value] and not the value specified by the…
-
2
votes1
answer1704
viewsHow to select a <option> of <select> with javascript/jquery
I have two selects, one for the employee and one for the function, where it is necessary that when an employee is selected the function of the employee is already automatically selected. That one…
-
2
votes0
answers421
viewsUse Select2 to search states and cities
I’m looking to improve the search for cities and states. I did this dynamic with the Select2: /*************** Procurar estado ***************/ $( ".estado" ).select2({ placeholder: "Estado", ajax:…
-
1
votes1
answer1140
viewsHow to change formatNoMatches in Lect2 4.0.0?
I’m using the Lect2 4.0.0 and I am having trouble changing the way the message is shown which indicates not having found results. In the old version used formatNoMatches to change the presentation,…
-
1
votes0
answers80
viewsSelect2.js with jquery.validate?
How can I use Jquery.validate to validate select field with the plugin select2?
-
1
votes2
answers3199
viewsAfter selection with Select2, how to automatically fill in form fields?
I am creating a form that has a field that the user will enter the company name and Select2 will perform a search in the BD and return the company name to the field, example in the image below:…
-
1
votes1
answer1611
viewsTake the value of a li and create an Hidden input with the value when the li is clickada
Good morning, gentlemen, I’m having a hard time making a move. I want that when clicked on li, it add in div #form an input type Hidden with the value of li. and that this happens only when clicking…
-
1
votes1
answer309
viewsSave Select2 tags via post to php
Hello, I would like to know how to send a POST with the tags selected in the select2 (version 4). My code works perfectly, but I cannot send the result of tags selected for the server php, soon none…
-
1
votes0
answers135
viewsSelect2 displays value instead of text
I have some fields that use Select2 to make a basic CRUD, but consulting some fields from another base. The question is, when I click update, I put in an array all table values (dataTables) and then…
-
1
votes1
answer344
viewsSelect2 display optgroup value and concatenated option
I’m creating a selection field where the user can choose between multiple states, but I need to show when selected both the optgroup value and the option value, have as? Remembering that I am using…
-
1
votes0
answers456
viewsSelect2 does not select
Using the Select2 plugin via json I can’t select any results. When you select it does not display the result. I am doing something wrong? $(".PessoaTipo").select2({ language: "pt-BR", placeholder:…
-
1
votes0
answers210
viewsHow to dynamically initialize a Select2 in Angularjs
Hello guys I am using the plugin of Select2 in my project. I need to create several selects2 dynamically, by angular. I have an object array (with id, name) and accurate from an event, in a function…
-
1
votes2
answers951
viewsWhen clicking an option from a list, hide options from another select
I would like, for example, when choosing the option '10 people' in the select 'Size', I could hide specific options in the selects 'Model', 'Fillings', 'Options to Drain' and 'Decoration'. Example:…
-
1
votes2
answers1484
viewsCreate a multi-category filter using a <select>
::EDIT:: Currently, the official code is like this, but the Almer code still does not work: Javascript <script> $(document).ready(function() { var arraySelects = ['modelo', 'massa'];…
-
1
votes0
answers321
viewsValue in Select2 multi select
Good afternoon, I’m having trouble returning the values of N items selected with Select2, it return only the first. I’m using Asp.net. <asp:DropDownList ID="ddlMeses" runat="server"…
-
1
votes1
answer351
viewsJquery Form Validation Position of the error div in select fields
To change the position of the error text in fields Select2. is appearing above the field, I want it to appear below! Any hint? <!-- /field --> <div class="col-md-3"> <div…
-
1
votes1
answer169
viewsPartialview not clicking on the default of Select2
I’m having a problem when I call my Partialview, it loads all the data in the View but not in the right format (layout) of Select2, in case when clicking the input appears the data, is currently…
-
1
votes0
answers138
viewshtml dropdown treatment for many options
I have a dropdown that is fed in PHP by consulting an Oracle database. It is working normally, but the amount it returns is 15,000 records and each record is an option in the dropdown. It makes the…
-
1
votes2
answers526
viewsHow to customize messages from Select2?
I want to remove messages from Select2: Searching; No Matches found; Follow the code below: Pagina Html <input id="ajaxSecretaria" type="hidden" style="width:300px" /> Script: $(function () {…
-
1
votes2
answers379
viewsSelect2 in multiple fields with the same name
I am making an order registration page, where you can register several products. To register the products users have the options to Produto, quantidade, valor, subtotal, if you want to add one more…
-
1
votes1
answer990
viewsLaravel Combobox Autocomplete Select2 JS
Can you help me? I have the code further down working perfectly. But when I put inside a modal, I can’t write inside the text field. VIEW <select class="itemName form-control"…
javascript laravel twitter-bootstrap self-cmplete jquery-select2asked 5 years, 8 months ago ShBr 139 -
0
votes0
answers129
viewsSelect2 does not open when screen is smaller
I have a problem when Select2 is in a form and near the end of the screen, so it does not open because it understands that there is not enough space, I would like to know how to do in this case. The…
-
0
votes0
answers38
viewslong script in IE
A client reported that in his IE is presenting a message that the script was too long, causing a lock. $(document).ready(function () { $('select').each(function () { $(this).select2({ allowClear:…
jquery-select2asked 9 years, 10 months ago Fábio Freitas 11 -
0
votes0
answers281
viewsIncrease the size of the Select2 plugin combobox
I need the plugin Select2 combobox (https://plugins.jquery.com/select2/) above is with the same effect of the combo that is below according to the image, that is, increase the width size without…
-
0
votes0
answers89
viewsSet array with "Combobox" dataSelect2
I have the following scenario: The user chooses a value on combobox Select2. Click on "SAVE" and this combobox Select2 should be stored in an array with the defined events. After this I would return…
-
0
votes1
answer4600
viewsHow to leave the first Option disabled and selected?
How can I start a selectbox of type Select2 with the first option selected as disabled? HTML: <div class="form-group"> <select name="tipoOperacao" id="tipoOperacao" class="selectTipo2"…
-
0
votes1
answer1611
viewsComponent Select2 with Angularjs
Good afternoon Someone uses the Select2 component (https://github.com/select2/select2) to create dropdown components? I am going through the following problem, I have two components in a javascript…
javascript html twitter-bootstrap angularjs jquery-select2asked 9 years, 5 months ago Giancarlo Abel Giulian 3,999 -
0
votes1
answer339
viewsCreate search tags for Select2
I’m using the library Select2. I’ll use it to search for help pages, but I need it to search for tags and not just for text in Option ex: Today: <optgroup label="Mountain Time Zone">…
-
0
votes0
answers35
viewsSelect2 selector implementation with Selenium Webdriver
I am new with automated testing and Selenium Webdriver (c#), currently I am doing a test where there is a Select2 field, need to know how to implement for my test look at this field and select a…
-
0
votes1
answer931
viewsGrab the selected item from the Select2 plugin and make a Submit
How to get the selected item from the Dropdownlist plugin Select2 (https://plugins.jquery.com/select2/), and send to a Controler via an Submit button ? CANVAS CONTROLER public ActionResult…
-
0
votes0
answers73
viewsQuery selector /3a
I’m making js of htmls complexes that were not structured by me. To facilitate use of Firebux or Chrome Developer to copy the ready selector. They return me this selector: #dadosCadastrais\3a…
-
0
votes0
answers268
viewsSelect2 options disappear when selecting a
I am using Select2 to load data remotely and it is bringing the results normally, but when selecting one of the returned options all existing ones disappear and I could not identify why, follow the…
-
0
votes2
answers1511
viewsHow to Reset Form Select2 and Multiselect Fields
I have a registration form where I reset the fields when entering a record with the following: document.getElementById(id).reset(); //Aqui passo o id do formulário The problem is I have a field now…
-
0
votes2
answers581
viewsChanging the contents of a <optgroup> label when selecting an option in another select
I would like to click, for example in the option "10 People"... It changed the label of several other selects, for example, this: "Special Fillings: R$10". I would like, for example, it to become…
-
0
votes0
answers35
viewsUse Ajax to load options from multiple selects after choosing an option
Ps.: This is not the same question already asked in another topic. This involves Ajax. I find it funny a lot of people marking it as duplicate without even reading the heart of each question or…
-
0
votes1
answer814
viewsBootstrap selectpicker class, does not recognize insertion of <option> via jquery (.html())
I’m using the Bootstrap framework, and the Selectpicker class to receive city data by status. The script works well, returns data, but instead of inserting <option> Cidade X </option> he…
-
0
votes2
answers712
viewsUpdate Cities Combo with jQuery when editing
I have an error in the update of select of cities, no create works correctly, I select the state and cities are updated. On Edit I can’t update cities according to the selected state. I’ve tried a…
-
0
votes1
answer460
viewsSelect2 does not work on my pc but works on jsfidle
This jsfidle code works, i.e., shows stylized select and select with input search. <html> <head> <title>TESTE</title> <script…
-
0
votes1
answer230
viewsSelect2 database
I have a Select2 that is populated from the database of everything working, receives the data of the bank and etc. however if I want to edit it does not bring the saved option on the screen only on…
-
0
votes0
answers231
viewsSelect2 with incorrect styling
I’m using a Lect2, but its style is coming in a way that wasn’t expected. That way: How I make it fit and align with the input-group? HTML code: <div class="form-row"> <label…