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
To give a scene: When the user login success, the browser will sometimes ask whether you remember the password, when you remember the password the next time you log in, the label will be automatically populated, but this will cause the style is not unified, the solution is as follows:{ border: 1px solid Green; -webkit-text-fill-color: Green; -webkit-box-shadow: 0 0 0px 1000px #000 inset; transition: background-color 5000s ease-in-out 0s;}CSS Modify Au
In order to strengthen the skill of MVC, strengthen the practice is the thing. Insus.net this time to realize the AutoComplete function of the text box.Create a table in data [PinYin]:Insert some data:INSERT into [dbo]. [PinYin] ([Word]) VALUES (' A '), (' Ai '), (' an '), (' Ang '), (' AO '), (' Ba '), (' Bai '), (' Ban '), (' Bei '), (' Ben '), (' Bi '), (' Bian '), (' Bie '), (' Bin ' ), (' Bing '), (' Ca '), (' Cai '), (' Cang '), (' Cao '), (' CE
as follows:
Like new capxous. AutoComplete ("wiki", function () {
Return "autocomplete3.asp?typing=" + Escape (this.text.value);
});
Then in the ASP to accept the value
Typing =trim (request.querystring ("typing"))
and then query
Set rs=conn.execute ("Select Ygbh,dw,ygxm from Wuhen_t_yg WHERE ygxm like '%" typing "% ' ORDER by YGBH DESC")
The problem is this, the query in the Address column input value can be received,
. Commonplace---XMLHttpRequest
Code
Copy Code code as follows:
var xmlHttp;
function Createxmlhttprequest ()
{
if (window. Actievexobject)
{
Xmlhttp=new actievexobject ("Microsoft.XMLHTTP");
}
else if (window. XMLHttpRequest)
{
Xmlhttp=new XMLHttpRequest ();
}
}
If you do not use jquery handwriting JavaScript, you should change it to a XMLHttpRequest object pool, which is not written.
-Trigger AutoComplete
Cjuiautocomplete can automatically prompt the user to enter text according to the first few characters entered by the user when entering. It encapsulates the JUI AutoComplete plug-in.
The basic usage is as follows
Automatically prompts the data source by configuring the Source property to complete, the actual application can be read through the database, files and so on. For simplicity, this example uses an array definition in Sitecontroller.
P
First download the required files, Jquery.autocomplete.js and Jquery.autocomplete.css.
Since the control gets data that can be obtained from the array and URL two ways, it writes two simple examples to experiment with.
The foreground code is as
Share an unintentional discovery of the automatic completion of the source code. This test is used in the array, when the actual use, we switch to Ajax from the server side of the way to get the OK.Tip: You can save directly to an HTML file to see
Compared to similar plug-ins, his characteristics are 3 points.
1, can be cached query results (two times faster query)
2, KeyUp monitoring mode (to solve some system/situation can not trigger keyxxx events)
3, concise parameters (good-looking?)
I. Brief
Yesterday support a colleague to help her clients do something like the following effect (auto-complete):
I used to get this when I was searching the house, call the real estate dictionary:
This is a small function, but also a big
vbscript| function |vbscript| function editplus is my most common asp/html/css development tool.
However, it only supports the automatic completion and function List of A/C + + system language, with no built-in ASP (VBSCRIPT) functionality. To
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.