In the work need to use the automatic prompt this function, hehe, oneself is JS vegetable, so Baidu a bit, find a with jquery and its plug-in autocomplete development of the. NET version of the automatic completion function, so down to the PHP version, and added support up/ Down to select text and other functions, put up to share, pure physical life ... :)
1, download jquery library, url: http://jquery.com/;
2, download the jquery
In the introduction of jquery AutoComplete components, encountered JS report not end string constant error, the reasons and solutions are as follows, we can refer to the following
On my question and the solution:
When I introduced the AutoComplete component of jquery, I encountered the JS report not ending string constant error.
Cause analysis: First, right-click Page view encoding is Utf-8,
Second, loo
Ajax
"Guide" This article describes how to achieve the function of Ajax automatic completion, that is, AutoComplete, for example, in the search box to enter a product model, you can see the effect.
The function that completes automatically is AutoComplete, the concrete example can look here: http://www.b2c-battery.co.ukEnter
January 5 Updated
Fix AutoComplete text box Focus shift, automatically complete a bug that the container cannot disappear
Add Expandallitem method, double click can appear all item, please see the example
Add the Customstyle example, which demonstrates how to embellish the AutoComplete control with CSS, see autocomplete_custom CSS File
Demo and Download:
http://www.never-online.net/code/neverModules/
Create a new ASP.net mvc3 project autocomplete.
Import the JS library to implement AutoComplete in the Shared/_layout.cshtml master page
Model, create a new singer class
public class Singer
{public
int Singerid {get; set;}
public string Singername {get; set;}
}
Project----Add asp.net folder----App_Data
To add a connection string in Web.config
Model to create a new inhe
Issue 1: The JSON string cannot be automatically recognized when it is obtained from a webserver or general application handler (. ashx) program, and is interpreted as a string type. In fact, it is not difficult to solve this problem, only need to overload a method, the following part of the code posted: the red part of the need to pay attention.
Copy Code code as follows:
$ ("#txt"). AutoComplete ("/asmx/executeplan.ashx", {
Extrapa
"AutoComplete" is when a user enters a Word 2010 document with the first few characters of the entry contained in the AutoText, Word displays a suggested prompt, and the user can enter a suggested entry as needed. The steps to enable the display of the mnemonic suggestions feature in Word 2010 are described below:
Step 1th, open the Word 2010 document window, and click the file → options button, as shown in Figure 2012010501.
Figure 2012010501 Cli
During project creation, you sometimes need to provide users with certain help information to prompt user operations. Of course, the suggest function is essential, but if you develop it yourself, it is time-consuming and time-consuming. Here we will use JQuery's autocomplete directly. The experiment proves that the result is very good. The front-end code is as follows:
The Code is as follows:
JQuery's Automatic completion Function
indent set Autoindentsetcindent "Settingstab width is 4 spaces settabstop=4setexpandtab "Unified indent to 4setsofttabstop=4setshiftwidth=4" matches parentheses highlight set showmatch "Match bracket Highlight time (1/10 seconds) setmatchtime=1" Pydiction configuration filetypepluginonletg: pydiction_location= ' ~/.vim/tools/pydiction/complete-dict ' letg:pydiction_menu_height= 20Use the TAB key in vim to automatically complete the completion.650) this.width=650; "src=" Http://s3.51cto.com/wyfs
JQuery: SP. NET Autocomplete Textbox Using jQuery, JSON and AJAX, jqueryautocomplete
///
. Net 4.0
Using System; using System. collections. generic; using System. linq; using System. web; using System. web. UI; using System. web. UI. webControls; using System. web. services; namespace DuCms. web {//
The text box automatically matches the phone number and name, and the data is the JSON data that is found, which encapsulates all objects (telephone, cellphone, name). Select a phone number,
The code for automatically filling a name is as follows:
$. Ajax ({
URL: '/account/ajaxfinduserphonelist ',
Type: 'Post ',
Cache: false,
Contenttype: "application/JSON ",
Datatype: "JSON ",
Success: function (data ){
$ ("# Input_pair_phone"). AutoComplete
AutoComplete implementation principleIt is mainly used on the input and textarea labels to add mouse events to the keyboard listening events and prompt lists.
For example, the input ID is TXT.
Add a keyboard listening event (keyup) for Input)
VaR mindex =-1; $ ("# TXT"). keyup (function (e) {e = E | window. event; If (E. keycode! = 27 E. keycode! = 38 E. keycode! = 40) {_ mtxt = $ (this ). val (); fqainit (_ mtxt, _ faqdata); // create a list} If (E
AutoComplete-jquery Application
I tried it today. It looks a bit like Google pull-down query.
Index.htm
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
M. aspx
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
M. aspx. CS
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Using system;
Using system. D
The home page of wagang.net requires a ComboBox component (AutoComplete ).
Qwrap contains a: http://dev.qwrap.com/resource/js/wagang/combobox/_examples/ComboBox-Demo.html,
However, this component is developed based on qwrap. However, I only want to reference a component, instead of introducing a qwrap library.
Fortunately, the Helper specification is used for qwrap database stacking. Many methods are static methods and can be independent of the method
1. Several library files are required
Jquerydatabase, jquery-uidatabase, jquery-ui-1.10.3.custom.min.css style table Library (of course, some IMG effects are omitted, you can download them on the official website)
2. Let's look at the prototype effect code:
Background code:
Protected void page_load (Object sender, eventargs e) {} private string _ datasetcachename; ///
For the sake of efficiency, the data is cached (the cache class is not pasted, and the corresponding key values of all cache
Syntax error, insert "]" to complete MemberExpression XXX. js (an error is returned when a Java Web Project imports a Jquery file), jquery. autocomplete
If you want to add a jquery plug-in written by someone else to your website project, the following error occurs: Syntax error, insert "]" to complete MemberExpression XXX. js.
If you change it as required, other problems will still occur.
(The html file associated with jquery cannot be added to the
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.