Introduction:
Here i will explain Create an Auto Complete List Like Google Using jQuery
Description:
On many sites you must have seen that
whenever you start writing in any TextBox then it starts showing the
predicted and related results that allow you to choose from a number of
available options. The best example is Facebook's Friends Finder and of
course Google.
Example:
Step 1
First of all you need to create a database in which all the country names are to be entered.
Step 2
After that you need to add jQuery 1.8.3 js and Jquery-ui. js file to your application.You
can either download my Zip Code and retrieve both the jQuery files from
there or can search for them on Google and can download them from
another site.
<html> <head runat="server"> <title>Auto Complete List </title> <link rel="stylesheet" href="css/jquery-ui.css" /> <script src="js/jquery-1.8.3.js" type="text/javascript" ></script> <script src="js/jquery-ui.js" type="text/javascript" ></script> <script type="text/javascript"> function LoadList() { var ac=null; ac = <%=listFilter %>; $( "#Country" ).autocomplete({ source: ac }); } </script> </head> <body onload="LoadList()"> <form id="form1" runat="server"> <h2> Auto Complete List</h2> <div class="auto-complete"> <label for="tags"> Type Country Name: </label> <input id="Country" /> </div> </form> </body> </html>
0 comments :
Post a Comment