Autocompleter using javascript php

Now i am using joomla as php CMS… I have to include an autocompleter in the form. Now thing is i have an array already stored with the values that i want to be shown in autocompleter…
So is it possible to have an autocompleter on php textbox which fetches values from array…

I tried search but all uses autocompleter fetching data from database but i hv already got the data in array… So just a javascript should suffice…

Please guide with tutorial or link to example with script or any suggestion which can help fulfill my requirement…

Thank you

Are you using jQuery? If so, it’s quite easy:


	
	<script>
	$(function() {
		// this would be your array of data
		var availableTags = [
			"ActionScript",
			"AppleScript",
			"Asp",
			"BASIC",
			"C",
			"C++",
			"Clojure",
			"COBOL",
			"ColdFusion",
			"Erlang",
			"Fortran",
			"Groovy",
			"Haskell",
			"Java",
			"JavaScript",
			"Lisp",
			"Perl",
			"PHP",
			"Python",
			"Ruby",
			"Scala",
			"Scheme"
		];
		// this is the input that you want the autocomplete to work on
		$( "#tags" ).autocomplete({
			source: availableTags
		});
	});
	</script>

If you’re not using jQuery, it’s still not too difficult, but it’ll require some more work.

Thank YOu for the prompt reply…

Well as such i am working on php CMS(Joomla) it uses mootools and using jquery with mootools did conflicted couple of times.

I tried this autocompleter with mootools
( AutoCompleter » digitarald:Harald Kirschner )
Above linked script runs fine when executed alone but when i include it inside the joomla website folder it stops workings…so i started looking after a solution with Javascript only