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
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
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
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
The front-end code is as follows:
Copy codeThe Code is as follows:
Then there is the background code. Of course, here we just simulate the data:Copy codeThe Code is as follows: using System;Using System. Collections. Generic;Using System. Linq;Using System. Web;Using System. Web. UI;Using System. Web. UI. WebControls;Using System. Text;Public partial class _ Default: System. Web.
In web front-end development, when it comes to selection, AutoComplete is a fairly common plugin, but there are some bugs when it comes to Chinese.When you enter a Chinese text each time, the plug-in works very well, when the input of multiple Chinese characters at a time, it can not produce filtering.This problem is particularly noticeable on mobile phones. This problem exists even with the mobile version of Autocomplete.Look at the source code, 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.