how to create textbox function autocomplate
in the post before I show you how to use datepicker in Jquey UI, the functionality when clicking on a selected date in textbox will display the following dates for you to choose, if anyone reading can be viewed here
in this article I will write to the rest as promised in the previous post, autocomplate function.
This is a useful function when your school too much and can not be used in the dropdown menu when you type any character what it will look and compare the results with available and appropriate to give you the most options.
work first and indispensable is the following 3 lines of code, and you leave it in the <head> okay:
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
then we will create one textbox with class as “kq”
<input type="text" class"kq">
Here are steps to declare the library functions and jquery and jquery ui, you can download and upload files to your hosting also or use this for fast also.
Now the next task, you create one file named list.txt example, in which you return to the results, each result will lie on one line.
Here is the code used to create applications autocomplate here:
$(document).ready(function()
{
$.get( "http://abc.com/list.txt" ).done(function( data ) {
$( ".kq" ).autocomplete( { source: data.split( "\n" ) } );
});
});
in the above code has two significant parts:
– “Http://abc.com/list.txt” this is the path to the file containing your results, you can easily change the outcome in this file.
– “.kq” This is the Claas as declared in the textbox at the top.
you did not? be sure, right?
This section also one other way, it can link to your database, this section will guide me probably in the next section. I mostly write the articles in the form of improvisation, tricks and practical experience in the process I do, can do so quickly without spending too much effort because I just really want to achieve results only that.
following section I will guide you retrieve from sql to do autocomplate okay!