Here's a javascript autocomplete function that responds to keyboard input.