jquery-ui-autocomplete

jQuery Autocomplete: Event-select

柔情痞子 提交于 2019-12-02 21:16:53
I am trying to submit a form when an item is selected from the menu. I set class on the search form and I am using the event select for it which is found here: http://docs.jquery.com/UI/Autocomplete#event-select Now, when you select an item using the keyboard (UP and Down), it works. But if you select an item using the mouse, it gives you the value which is previously typed. Check this screenr: http://www.screenr.com/7T0s This is what I use for submitting: $("#searchform-input").autocomplete({ select: function (a, b) { $(".searchform1").submit() } }); This is because the select event's default

What are the “response” and “request” arguments in jQuery UI Autocomplete's “source” callback?

爷,独闯天下 提交于 2019-12-02 21:09:13
I'm looking at the autocomplete tutorial, and I have a few questions: http://jqueryui.com/demos/autocomplete/#option-disabled $( "#tags" ) // 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(); } }) .autocomplete({ minLength: 0, source: function( request, response ) { // delegate back to autocomplete, but extract the last term response( $.ui.autocomplete.filter( availableTags, extractLast( request.term ) ) ); }, focus: function()

Display an icon in jQuery UI autocomplete results

怎甘沉沦 提交于 2019-12-02 19:38:16
I'm using the jQuery UI Autocomplete plugin (version 1.8), and I'd like to customize the way the suggestions show up. Specifically, I want to display not only some text, but an icon as well. However, when I send the <img> tag, it just gets rendered as plain text in the results list. Is there some way to change this behavior? Alternatively, can you suggest a different way to include images in the returned results and have them show up in the suggestions? Taken from here $("#search_input").autocomplete({source: "/search", minLength: 3, select: function (event, ui) { document.location = ui.item

jQuery UI - Formatting the autocomplete results. Add image possible?

寵の児 提交于 2019-12-02 19:21:25
We're moving from the bassistance.de autocomplete to jQuery UI autocomplete. I can't find as many examples for the jQuery UI version, the documentation seems a little sparse. That could just be me. I'd like to know if anyone has an example/tutorial which explains how to alter the look and feel of the autocomplete drop down. My code is as follows: $( "#SearchInput" ).autocomplete({ source: function( request, response ) { $.ajax({ url: "http://servername/index.pl", dataType: "json", data: { term: request.term }, success: function( data ) { response( $.map( data.items, function( item ) { return {

JQuery reusable autocomplete function

早过忘川 提交于 2019-12-02 10:25:49
Hello fellow SO friends, I am having trouble with my syntax in adding a .data custom render to this autocomplete function. Where/how do I add: .data( "autocomplete" )._renderItem = function( ul, item ) { return $( "<li></li>" ) .data( "item.autocomplete", item ) .append( "<a>" + item.value + " | " + item.desc + "</a>" ) .appendTo( ul ); }; To this code: function Autocomplete(numberLocation,nameLocation,dscLocation,chargeLocation) { $(numberLocation).autocomplete ({ minLength: 4, source: function(request, response){ var fundnum = $(numberLocation).val(); fundnum = escape(fundnum); var

jQuery-ui autocomplete multiple values sort results alphabetically

陌路散爱 提交于 2019-12-02 08:21:48
With reference to this question Sorting Autocomplete UI Results based on match location , there is a solution that provides for single value jQuery autocomplete but is it possible to get a similar solution for multiple values jQuery autocomplete ( http://jqueryui.com/autocomplete/#multiple )? The only difference here is that you need to make sure and call extractLast like the demo you linked to is doing. Here's the complete code that should work with multiple values (pay particular attention to the source option): $("#tags") .on("keydown", function (event) { if (event.keyCode === $.ui.keyCode

jquery ui autocomplete not working in ie8 (until page refresh)

谁说我不能喝 提交于 2019-12-02 02:25:48
问题 I am using jquery ui autocomplete it is working absolutely fine in all browsers except ie8. I have been doing some testing and there seems to be a strange bug. When I click on a link leading to the relevant page there is the following error generated by ie8 when I start typing in the autocomplete box: 'object doesn't support this property or method' this error points to my development jquery(1.4.2) file at line 4955, char 5 which is the following line: return new window.XMLHttpRequest();

jquery ui autocomplete not working in ie8 (until page refresh)

对着背影说爱祢 提交于 2019-12-02 02:14:15
I am using jquery ui autocomplete it is working absolutely fine in all browsers except ie8. I have been doing some testing and there seems to be a strange bug. When I click on a link leading to the relevant page there is the following error generated by ie8 when I start typing in the autocomplete box: 'object doesn't support this property or method' this error points to my development jquery(1.4.2) file at line 4955, char 5 which is the following line: return new window.XMLHttpRequest(); However, if I simply reload the page the autocomplete works. I have added a random bit of data to be called

Rails4-autocomplete form with multiple inputs - HTML data-id-element overwritten

对着背影说爱祢 提交于 2019-12-02 01:45:42
问题 I am trying to build a form that is going to suggest medicine name from database but will send ID of chosen medicine to create relation in my database. I used autocomplete gem which works great, I also used their hint for getting ID out of elements name and this works fine as well but only to the point where there is ONE INPUT element on form. In my case I need 5 inputs and because of my code - it keeps overwritting element called my_medicine_id which causes that only one - last - element is

Rails4-autocomplete form with multiple inputs - HTML data-id-element overwritten

老子叫甜甜 提交于 2019-12-02 01:30:30
I am trying to build a form that is going to suggest medicine name from database but will send ID of chosen medicine to create relation in my database. I used autocomplete gem which works great, I also used their hint for getting ID out of elements name and this works fine as well but only to the point where there is ONE INPUT element on form. In my case I need 5 inputs and because of my code - it keeps overwritting element called my_medicine_id which causes that only one - last - element is being saved. Can you guys think of any solution for dynamically changing field name? My