jquery-ui-autocomplete

JQuery Auto-Complete: How do I handle modifications?

China☆狼群 提交于 2019-12-10 22:27:22
问题 I have auto-complete working, but how do I handle modifications? What happens when the user modifies the original selection? I've got an auto-complete that, when a listing is chosen, other fields are filled in. If the user chooses a listing, then tries to modify it to something that is new (does not match anything in our DB), the other fields need to be cleared. Another way of asking: How do I handle 'new' listings? My code below $(function() { $( "#oName" ).autocomplete({ source: "include

Autocomplete jquery not working?

廉价感情. 提交于 2019-12-10 21:50:31
问题 I have a text box, Inside I want it to auto complete. The data for the auto complete is going to be given through the database. This is my Jquery: var data = "autocompletetagdata.aspx" $("#item").autocomplete({ source: data }); This is what I have put in autocompletetagdata for now: protected void Page_Load(object sender, EventArgs e) { string term = Request.QueryString["term"]; SqlConnection myConnection = new SqlConnection(connStr); myConnection.Open(); string SQL = ("select Top 10 LTRIM

How to tag users in feed like Facebook or Twitter does?

霸气de小男生 提交于 2019-12-10 21:43:54
问题 HI I am working on a rails application. I want to implement user tagging as facebook or twitter does. When user is posting in feed he can tag any user with @ character at starting. I am using Jquery UI Autocomplete plugin. I have this reference Implementing jquery UI autocomplete to show suggestions when you type "@" which helped me to implement auto complete part. But now I want to link that auto completed username to users profile url e.g Username = Mak then link should be generated like <a

jQuery autocomplete won't show more than 10 results

廉价感情. 提交于 2019-12-10 21:24:26
问题 I'm using the jQuery autocomplete, and no matter what settings I change, I can't get it to show more than 10 results in the dropdown. I can see in the results coming back that I'm getting all of them from the server, but the front end won't show more than 10. $("#add_cpt_code_text").autocomplete('<%: Url.Action("SearchCPT", "ChargeCapture") %>', { autoFill: false, mustMatch: true, matchContains: true, cacheLength: 1, maxItemsToShow: 15, minChars: 3, extraParams: { LocationID: 0 }, formatItem:

JqueryUI Autocomplete: autoFocus = true won't do anything

白昼怎懂夜的黑 提交于 2019-12-10 17:35:08
问题 i have this input with autocomplete feature: .autocomplete({ source: "jsonR.php", minLength: 2, select: function( event, ui ) { $(this).val(ui.item.value); llamar('/includes/router.php?nomenu=1&que=view_item&id='+ui.item.id,'router'); return false; }, autoFocus: true ,open: function() { $('.ui-autocomplete').addClass('searchBox'); } }) Basically i want the feature to select the first item so if user hits enter it searches the first one but this wont hover/focus the first item suggested, any

jQuery autocomplete mouse choice fires the blur event

岁酱吖の 提交于 2019-12-10 12:49:15
问题 I use the jQuery UI .autocomplete() , which I really love. I do have one major problem I cannot solve. When I type a letter, say s , and stackoverflow appears in the drop-down menu, and I use the mouse to select stackoverflow , then the input box temporarily loses focus, which causes the onblur event to be called. Although technically the input box is blur ed when I click, this goes against usability intuition. How can I fix this annoying behavior? 回答1: you can try using the jQuery UI

How to get JQuery UI Autocomplete work with item id

谁都会走 提交于 2019-12-10 10:02:14
问题 I have seen this post here: jQuery UI autocomplete with item and id but I was not able to figure things out. here is my input html: <input type="text" class="tags" style="width:250px; height:24px;"> </input>' <input type="hidden" name="tags_id" id="tags_id" /> here is my ajax call: var data = {}; $.get('/tags',data, function(tag_list) { autocomplete_source_list = []; for(var i = 0; i < tag_list.length; i++){ autocomplete_source_list.push([tag_list[i].fields.display_name, [2,3,4,5,6,7,8,9,1,2]

jqueryUI autocomplete menu show effect

纵饮孤独 提交于 2019-12-10 08:09:14
问题 I spend half of a day trying to apply fade effect for autocomplete drop down menu... The final result is very uncomfortable for me - look like 'lucky shoot', not real solution. I used jqueryui default demo for example, and add lines: var acMenu = $("#tags").data().autocomplete.menu.activeMenu; acMenu._basehide = acMenu.hide; acMenu.hide = function(){ this._basehide("fade","slow"); }; acMenu._baseshow = acMenu.show; acMenu.show = function(){ this._baseshow("fade","slow"); }; The whole file

How To Select First Element in AutoComplete dropdown list

℡╲_俬逩灬. 提交于 2019-12-10 02:56:23
问题 Can any one help me how to select first element of autocomplete dropdown list if no element is selected? I tried with autoFocus. working for key board events. If I use mouse, the first element is not selecting which is auto focused. 回答1: visit here for answer $('#txt_search_city').autocomplete({ source: url, delay: 0, autoFocus: true, select: function( event, ui ) { $( "#id_city" ).val( ui.item.id ); $(this).closest('form').submit(); }, focus: function( event, ui ) { event.preventDefault(); }

Repositioning jQuery UI Autocomplete on browser resize

隐身守侯 提交于 2019-12-09 06:07:47
问题 There is an issue if you open up an autocomplete drop down and also resize your browser window the autocomplete drop down does not reposition. Highlighted in this video: http://www.youtube.com/watch?v=d7rZYH0DgWE I have looked at the documentation and cannot find a reposition method (in the jquery-ui documentation http://jqueryui.com/demos/autocomplete) that can be called within a $(window).resize() function call. Is there an elegant soultion to this? 回答1: I would suggest just closing the