Input element with suggestion

There are 2 kinds of suggestion methods:
the texts can either be completely loaded into the browser memory once or they can be dynamically added from the database as you type.

Example of the 2nd method:
Google Suggest

Here you will find a solution for the 1st method. This solution works for MSIE versions 5 and up and for Gecko-based browsers (Netscape versions 6 and up, Mozilla, Firefox).
It does not work in older versions of Opera and in Netscape 4. (The suggestion box doesn't appear in these browsers.) In Opera 7 you can select with a mouse.
If you like our script,
please rate it at HotScripts.com

To test the element, type any letter into the textbox. We suggest the names of European capitals.

To see how the suggestion works with too many variants, type the letter "B". (The actual maximal size of selection is 5.)
Download the script

Open the script in a text editor.
You have to configure 3 parameters:
  1. The array with suggest texts
  2. The ID of the textbox it will be suggested for
  3. The maximal size of the suggestion box
Then bind the script into the <HEAD>-area:
<script type="text/javascript" language="JavaScript" src="suggestInput.js"></script>

Change log: in the newest version, the script works with any DOCTYPE.