jquery-ui-autocomplete

jquery autocomplete set hidden input value

若如初见. 提交于 2020-01-06 07:05:02
问题 I have the following jquery autocomplete which does work. <input type="hidden" id="autocompletePid" autocomplete="off" /> The relevant JS <script type="text/javascript"> $(function() { $("#autocomplete").autocomplete( { source : function(request, response) { $.ajax({ type : 'GET', url : "/live-search" + '?term=' + request.term, success : function(data) { response($.map(data, function(item) { return { label : item.street + ' ' + item.city.city + ', ' + item.state.stateCode + ' ' + item.zipcode

Autocomplete: first item focused only when the user type on tab key

白昼怎懂夜的黑 提交于 2020-01-05 09:26:29
问题 By using jqueryUi autocomplete I would like the first item automatically focused only when the user type on tab key . How should I perform this task? Initialising a autocomplete with the autoFocus option true specified does not fit my purpose! Any ideas? Here is my code. Please see the comment for more details. element.autocomplete({ minLength: 3, // the following option "autoFocus = true" // make the first item focused when the user type the first 3 letters // I would like the first item

getting jQuery ui autocomplete to work with @mentions only

泄露秘密 提交于 2020-01-05 06:29:03
问题 I've had a look at a few questions, such as https://stackoverflow.com/a/7222592/2332251 I'm still having trouble reconciling it with the code I have. At the moment the following works perfectly for searching a username as I start typing. $(function() { $("#appendedInputButton").autocomplete({ minLength: 2, source: "searchusers.php" }); }); The function in searchusers.php outputs the usernames from the database. As I said, I'm having trouble making other @mention solutions work for me. I've

getting jQuery ui autocomplete to work with @mentions only

只谈情不闲聊 提交于 2020-01-05 06:28:24
问题 I've had a look at a few questions, such as https://stackoverflow.com/a/7222592/2332251 I'm still having trouble reconciling it with the code I have. At the moment the following works perfectly for searching a username as I start typing. $(function() { $("#appendedInputButton").autocomplete({ minLength: 2, source: "searchusers.php" }); }); The function in searchusers.php outputs the usernames from the database. As I said, I'm having trouble making other @mention solutions work for me. I've

How to edit input into jQuery Autocomplete before search?

时光毁灭记忆、已成空白 提交于 2020-01-04 01:19:30
问题 I have an autocomplete box that (for the purposes of this example, since it's a simple example) returns a list including social security numbers. These have dashes in them for readability. I want to modify the autocomplete so that if I put in "123456789" or "123-45-6789", it will find the same entry in the autocomplete, without having to add both styles to the autocomplete source. I've been looking at adding a callback to search , but I'm drawing a blank on exactly how to accomplish this. If

jQuery UI Autocomplete Multiple Values

给你一囗甜甜゛ 提交于 2020-01-03 20:58:52
问题 I'm having a weird issue with my jQuery Autocomplete. I have an autocomplete textbox which retrieves multiple values and lists them fine, however, what I want to do is have another value for each selected item in hidden field. Here's the code I'm using: $('#RecipientsList') // don't navigate away from the field on tab when selecting an item .bind( "keydown", function( event ) { if ( event.keyCode === $.ui.keyCode.TAB && $( this ).data( "autocomplete" ).menu.active ) { event.preventDefault();

jquery autocomplete textbox set value programmatically

[亡魂溺海] 提交于 2020-01-02 02:18:09
问题 I am using jquery 1.8.2 and jqueryui 1.9.0 libraries. I am trying to add an "Edit Record" dialog to my table which contains a autocomplete textbox of jquery-ui. I am also using the change event of autocomplete to restrict the user for selecting the items from the given list. My problem is: when I show my edit form, I am setting the existing data to the textbox, however when user clicks on another field in edit form, the change controller popping the error of nothing changed. I have found many

autocomplete display relevant data in autocomplete window

倖福魔咒の 提交于 2020-01-01 05:26:06
问题 I have 3 input fields , 1 for data type and other 2 are its relevant. when i press button in data type field i want to display autocomplete window like this instead of this And after select it should look like this HTML <tr> <td><input type="text" id="no_1" class="form-control"></td> <td><input type="text" data-type="vehicle" id="vehicle_1" class="type form-control"></td> <td><input type="text" id="type_1" class="form-control"></td> </tr> JS $(document).on('focus','.type',function(){ type = $

jQuery UI autocomplete (combobox): how to fill it with the result of an AJAX request?

[亡魂溺海] 提交于 2020-01-01 02:48:09
问题 Is it possible to work with combobox as with usual jquery-ui ajax autocomplete field? What I need? I want there will be some default options and when user try to put any letters it must connect to the server to find requested information (as usual remote json autocomplete). Is it possible at all? 回答1: Here's a heavily modified version of the jQueryUI example (gist): $.widget("ui.combobox", { _create: function() { var _self = this , options = $.extend({}, this.options, { minLength: 0, source:

jqueryui autocomplete limit multiple selections

孤人 提交于 2019-12-31 03:36:12
问题 I am using the jQuery UI autocomplete and I am attempting to limit the multiple results. Basically I'm building a PM system I am using the autocomplete for the to field. But I'm trying to limit the amount of people a single message can be sent to. So like limit the max selections to 25. Is there any way to limit this? Also any ideas on a visual indicator that they have reached the max? select: function( event, ui){ var terms = split( this.value ); if(terms.length <= 2) { // remove the current