attribute that is used to associate a specific AutoComplete class. When AutoComplete is enabled, you do not need to repeat common information in the self-love form. If the browser AutoComplete is not disabled, the browser prompts the user to enter the same value as the previous one. (Even if you enter form fields in different websites) The Code is as follows:
Because the project needs to use an auto-completion function, function Description:Requirement one: When adding a recipient, the automatic drop-down displays all the recipient information in the database (the displayed information includes: name-to-receive address-contact info)Demand two: Select a worthy time, assign value to the corresponding text box (the recipient input box in the assigned name, the contact input box to assign the value of the phone number, the address in the input box assign
Usually with Baidu, Google search when there will be a drop-down list to prompt this is a very good feature this article is to introduce the jquery plugin called Ajax Autocomplete as the name implies that Ajax is the Ajax way to get the search hint information and then return to the renderedGossip doesn't say much directly on the codeThe files used in this article are:1, click Ajax Autocomplete for JQuery,
Auto-associative full effect based on jquery text box. This is a simple to use jquery AutoComplete plug-in, you can define index keywords, you can set the width of the input box, support search callback function. As follows:Online preview Source DownloadThe implemented code.HTML code:DivID= "Demo"> Divclass= "wrapper"> H3>Try typing "love programming."H3> DivID= "Search-form">Div> DivID= "message">Div> Div>
Automatic completion, provided that the Jquery-ui CSS and JS must be introduced, otherwise it will not be completed automatically.html lang="en">head> meta charset="Utf-8"> title>JQuery UI Autocomplete-default functionalitytitle> link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/ Smoothness/jquery-ui.css "> script src="//code.jquery.com/jquery-1.10.2.js">script> script src="//code.jquery.com/ui/1.11.4/jquery-ui.js">script> link rel=
When you enter AutoComplete, you can give a prompt based on the user input. The data source can be local or remote. The DataSource of AutoComplete can use a Function. In this article, we use JSONP to query the Function.When the data source is Function, its Function is defined:Function (Object request, Function response (Object data ))Request is a request that contains a term attribute, Which is input by the
Find the following code:Copy codeThe Code is as follows:. Bind ("blur. autocomplete", function (event ){If (self. options. disabled ){Return;}
ClearTimeout (self. searching );// Clicks on the menu (or a button to trigger a search) will cause a blur eventSelf. closing = setTimeout (function (){Self. close (event );Self. _ change (event );},150 );});Replace:Copy codeThe Code is as follows:. Bind ("blur. autocomplete
Problem 1: When a json string is obtained from a webserver or a general application processing program (. ashx), it cannot be automatically identified and is interpreted as a string type. In fact, it is not very difficult to solve this problem. You only need to reload a method. Below we will post some code: Pay attention to the red part.Copy codeThe Code is as follows:$ ("# Txt"). autocomplete ("/Asmx/ExecutePlan. ashx ",{ExtraParams: {hosid: HosID, p
Introduction
The AutoComplete control is used when you enter the first few letters or Chinese characters in the text box. This control can prompt you all the data starting with these letters from the text or database that stores the data, for your convenience.
Important attributes
1. TargetControlID: Specifies the control to implement the prompt function;
2. ServicePath: the path of the WebService. The data extraction method is written in a WebService
Directory (?) [-]
There are two types of autocomplete
One is the AutoComplete httpjqueryuicomautocomplete in the jquery UI.
The other is the ASPNET AJAX Control Toolkit httpwwwajaxtoolkitnet which seems to support only WebService
AutoCompleteAutoComplete there are two types of AutoComplete in the jquery UI http://jqueryui.com/
After effects, we will inevitably mention two controls under controls. JS: AutoComplete and inplaceeditor. These two controls are very popular in the Ajax era.ArticleDescribes how to use the autocomplete control. Declaration Method
New
Ajax. AutoComplete (
"
Textboxid
"
,
"
Choicesid
"
,
"
Requesturl
"
, Options)
Options Parameters
Jquery-based AutoComplete is an automatic query completion plug-in. Based on user input, it communicates with the background in real time through Ajax, and returns appropriate content to generate a selectable list for use to complete the completion auxiliary function. It has more detailed options to set. If you want to use it, you can first look at the official instructions.
This article discusses the necessary modifications as needed. For example,
suggestion entry, and value indicates the text displayed in the text box after an entry is selected:
JE: AutoCompleteID= "AA"Runat= "Server"Source= "['Vs 100',' vs 100', 'vs 100',' vs 100', 'vs 100']">JE: AutoComplete>
In the code above, if you enter vs 201, the recommended entry vs 2010 is displayed.
Address
IfSourceIf the attribute is specified as an address, this address should returnJavascriptArray, in the same form as above:
JE: AutoComp
The AutoComplete plug-in brings us a lot of convenience.
Http://view.jquery.com/trunk/plugins/autocomplete/demo/
There are some source code demos. I want to carefully study its code intent. (View Graph Analysis Code)
(1) single city (local) indicates local data. What is the background processing?
$ ("# Singlecity"). Focus (). AutoComplete (cities );
At this ti
Original: http://blog.csdn.net/moremoreTea1983/archive/2007/06/13/1651273.aspx
The ajaxcontroltoolkit series controls released with Asp.net Ajax 1.0 bring a lot of convenience to developers, but many of them seem not as perfect as we think. Recently, many AutoComplete controls have been used here and several shortcomings or errors have been found:1. In some cases, the error "two components with the same ID" may occur;2. It is easy to see "unable to
Jquery-autocomplete configuration:
The first is the simplest AutoComplete (auto-complete) code fragment:
Copy Code code as follows:
The result method is an important method in the jquery AutoComplete plug-in, which is triggered when a user selects an item. The data parameter is selected.
A slightly more complex example, you can customize
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.