jQuery is a powerful javascript liberary, which dramatically simplify the manipulation of elements on a web page and much more.
jQuery UI is a set of user interface objects implemented by jQuery. jQuery UI contains an autocomplete widged which I find very useful.
To implement the widget:
<script type="text/javascript" src="js/ui/jquery.ui.autocomplete.js"></script>
Where js/ui
is the relative path to the folder where your files from previous point are located.
$(function() {
$( "#i1".autocomplete({
source: "data.php",
minLength: 1
});
});
i1
is the ID of the input field you want to have autocomplete on. 'data.php' is the file responding to the queries of the widget.
Requirement: You will need a Google Account for this. You can create a new one here: https://www.google.com/accounts/NewAccount