jquery-autocomplete

how to use jquery validation with jquery autocomplete in my code

▼魔方 西西 提交于 2019-12-04 19:10:57
hi i am using codeigniter . i am using ajax autocomplete for jquery and jquery validation plugin there is input box called city <input type="text" class="city" name="city" value=""> i use autocomplete for this inputbox jquery code var a = jq('.city').autocomplete({ serviceUrl:"<? echo $this->config->item('base_url'); ?>home/auth/city_autocomplete", }); image of this when i select a value from the drop down the jquery validation plugin gives an error , 'min length 3'. but the city name is greater than 3 charactors this is my validation plugin code var x=jq("#contactinfo").validate({ rules: {

jQuery Autocomplete order of results

可紊 提交于 2019-12-04 19:05:56
问题 I am using the jQuery-autocomplete plugin to get suggestions for completion of the input string using an AJAX call to a server. Also, the server takes care of returning the results in the order I would want them to appear but autocomplete shows them in a different order. How can I configure jQuery autocomplete to not reorder the output ? I don't require any kind of processing on the client's end as the data has already been ranked/sorted as required. 回答1: Simply sorting the server results

How to design an MVC5 Global Search feature in Layout.cshtml

为君一笑 提交于 2019-12-04 17:44:18
I am trying to implement a "global search" feature, that is available above our main menu, in all Views within our application. It looks like this: The "global search" is a jQuery autocomplete input field. It resides in our _Layout.cshtml, which is a shared View and gets loaded many times by other views. Essentially it will display an auto-suggestion list for search keywords. Our list of keyword suggestions is roughly 6000 items. Our HomeController looks like this: public class HomeController : Controller { public ActionResult Index() { return View(); } public ActionResult Home() { ViewBag

Redirecting users on select from autocomplete?

百般思念 提交于 2019-12-04 13:17:08
i'm trying to implement the jquery autocomplete plugin. I've got it up and running, but something is not working properly. Basically i have a autocomplete-list of employees. The list is generated from a table in a sql-database (employee_names and employee_ID), using a VB.NET handler (.ashx file). The data is formatted as: employee_name-employee_ID. So far so good and all employees are listed in autocomplete. The problem is that i don't know how to redirect a user to a certain page (for example employee_profile.aspx) when they've selected an employee from autocomplete. This is my redirect-code,

jQuery UI custom AutoComplete - `_renderItem` and `_renderMenu` not working

泪湿孤枕 提交于 2019-12-04 10:46:34
I've used some code from a combobox demo, and now that i am trying to add some classes to the list-items, the _renderItem and _renderMenu, has no effect. the code (with some irrelevant lines, to make sure that i miss nothing) this.input = $("<input>") .appendTo(this.wrapper) .val(value) .attr("title", "") .addClass("custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left") .autocomplete({ autoFocus: true, response: function (event, ui) { if (ui.content.length == 0) { ui.content.push({ label: "new value: " + $(this).val(), value: $(this).val(), id: 0 }); } },

JQuery autocomplete server-side matching

徘徊边缘 提交于 2019-12-04 08:43:45
I am trying to setup an autocomplete field. I'v read the JQuery UI documentation, but all the example assume the source is a static list of items from which JQuery will pick matching entries (I mean static = the list is complete and doesn't depend on what the user typed). Here is the code from the "remote datasource" example: $( "#birds" ).autocomplete({ source: "search.php", ... I would like JQuery to call search.php?query=mytext (this URL returning a list of matching items) because I need to lookup suggestions in a database using PHP. Is there a way to do that? Maybe I didn't understand the

How to place autocomplete menu above the text input?

痴心易碎 提交于 2019-12-04 08:09:27
Is there any way to display the Autocomplete result set above the text input? The problem is that I am using it in a lighbox application. The background element being set to 100% of the pages' height and width, it will naturally not expand with its content. So if the content above the text box increases so much that the input is forced towards the bottom of the page, and then the user types something into it, the autocomplete menu appears, and the input being towards the end of the page, the menu causes scrollbars to appear Since the background element (dark colored) won't expand to

How can I make this link clickable in JQuery UI Autocomplete? Uncaught TypeError

ⅰ亾dé卋堺 提交于 2019-12-04 05:59:28
问题 I'm trying to use the Jquery UI autocomplete plugin, and i'd like to render some html in the suggest box, with clickable links. The html seems to render ok, however when I click the links, they don't work and I get in my developer log: jquery-ui.min.js:239Uncaught TypeError: Cannot call method 'data' of null Uncaught TypeError: Cannot call method 'data' of null a.widget._create.menu.a.addClass.appendTo.mousedown.menu.selectedjquery-ui.min.js:239 a.Widget._triggerjquery-ui.min.js:23 a.widget

Cant override jQuery UI autocomplete renderItem method multiple times

こ雲淡風輕ζ 提交于 2019-12-04 03:37:07
It overrides properly in the first autocomplete found, but do nothing with the rest. Instead it loads the original _renderitem method that you can see at https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.autocomplete.js#L449 . $(".someClassWithMultipleItemsOnDOM").autocomplete({ delay:500, minLength:2, source:path" ..... }).data( "autocomplete" )._renderItem = function( ul, item ) { thanks in advance There's a workaround for this problem: var autoc = { delay: 500, minLength: 2, source: path, ..... }; var renderItem = function (ul, item) { return $("<li></li>") .data("item

jQuery UI Autocomplete with ASP MVC

五迷三道 提交于 2019-12-03 20:16:51
I'm trying to get the jQuery Automcomplete thing to work, but it wont do as i want :P This is my code: JavaScript: $("#CustomerID").autocomplete({ source: function(request, response) { $.ajax({ type: "POST", url: "/customer/search", dataType: "json", data: { term: request.term }, error: function(xhr, textStatus, errorThrown) { alert('Error: ' + xhr.responseText); }, success: function(data) { response($.map(data, function(c) { return { label: c.Company, value: c.ID } })); } }); }, minLength: 2, select: function(event, ui) { alert('Select'); } }); ASP MVC: [AcceptVerbs(HttpVerbs.Post)] public