Back to JS main page

DATE:1996-10-20


Event Polling in JavaScript


JavaScript is missing one rather important event handler. Key_Down! A while back I was working on a small client side database search script. I wanted the script to catch key presses within various text fields so that the fields being queried could be narrowed in response to each key entry. Unfortunately, JavaScript doesn't provide this so I had to create my own little work-around.

As you enter individual values into the text field below a loop is polling to catch each individual entry. As far as I can tell this is as close as you can come to implementing a Key_Down event in JavaScript.

Enter Something:

If you want this script just choose "Save Frame As..." (in Netscape) when you have the focus on the frame.

URL: http://www.oocities.org/SiliconValley/7116/jv_keydn.html