I am developing a web page which has a requirement of many autocomplete textboxes. As I am new to javascript, it is very tough for me to make my own autocomplete textbox. So
You can use dataList it is easy way for autocomplete text box
If you are new to web development I'd recommend you to use jquery and jqueryUI package. The link above is to demo page where you can play with different types of datasources. I've copied an example which uses simple array as a datasource
<script>
$(function() {
var availableTags = [
"ActionScript", "AppleScript",
"Asp", "BASIC",
"C", "C++",
"Clojure", "COBOL",
"ColdFusion", "Erlang",
"Fortran", "Groovy",
"Haskell", "Java",
"JavaScript", "Lisp",
"Perl", "PHP",
"Python", "Ruby",
"Scala", "Scheme"
];
$( ".tags" ).autocomplete({
source: availableTags
});
});
</script>
<div><input class="tags" type="text" /></div>
<div><input class="tags" type="text" /></div>
The AutoSuggest
plugin has been deprecated and is now included in jQuery UI
.
Check this out:
http://jqueryui.com/demos/autocomplete/