jquery-select2

jQuery Select2 - Use tab to select an option

不羁的心 提交于 2020-12-14 06:34:20
问题 I'd like to be able to use the arrow keys to get to the select2 option I want and then press tab to select that option and then tab to the next element as usual. I already got the down arrow to open the select2 with the following: $(document).on('keydown', '.select2', function(e) { if (e.originalEvent && e.which == 40) { e.preventDefault(); $(this).siblings('select').select2('open'); } }); And I can also use the arrows to get where I need to go. Now I'm struggling to make the tab part work. I

show item request form when an unknown item is selected in select2

时光毁灭记忆、已成空白 提交于 2020-12-13 03:51:27
问题 I would like to use select2 to show a company search. If the company the user is looking for is not in the current dataset we need to show a company request form to add the data. html <head> <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" /> <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/js/select2.min.js"></script> </head> <body> <select class="js-example-basic-single" name="company"> <option value="1">(FB)

show item request form when an unknown item is selected in select2

冷暖自知 提交于 2020-12-13 03:51:06
问题 I would like to use select2 to show a company search. If the company the user is looking for is not in the current dataset we need to show a company request form to add the data. html <head> <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" /> <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/js/select2.min.js"></script> </head> <body> <select class="js-example-basic-single" name="company"> <option value="1">(FB)

show item request form when an unknown item is selected in select2

狂风中的少年 提交于 2020-12-13 03:50:58
问题 I would like to use select2 to show a company search. If the company the user is looking for is not in the current dataset we need to show a company request form to add the data. html <head> <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" /> <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/js/select2.min.js"></script> </head> <body> <select class="js-example-basic-single" name="company"> <option value="1">(FB)

select2 MULTIPLE placeholder does not work

梦想与她 提交于 2020-12-08 05:25:50
问题 I'm using the following piece of code to select item but placeholder already is not visible. I am using this example select2-bootstrap <div class="form-group" style="width:70px; height:44px;"> <select class="form-control select2" multiple="multiple" id="select2" placeholder="cawky parky"> <option>ahoj</option> <option>more</option> <option>ideme</option> <option>na </option> <option>pivo?</option> </select> </div> <script src="//select2.github.io/select2/select2-3.4.2/select2.js"></script> $