Some simple JavaScript test scripts for dealing with input text fields on forms and keyboard events. For more info, see http://www.wsabstract.com/javatutors/javascriptkey.shtml and http://www.wsabstract.com/javatutors/javascriptkey6.shtml, and documentation and examples on the HTML onkeypress event at http://www.htmlcodetutorial.com/forms/_INPUT_onKeyPress.html.

Somne of these scripts have not yet been modified to work under Netscape; most function only under IE. Also need to add code to deal with the backspace key (i.e. allow control chars to pass thru).

Warren Blatt, Nov 2002


Simple OnKeyPress alert:


Numbers Only:


Which Key Was Pressed?:


Alphabetic Input Only, for Surnames:


Alphabetic Input Only, for Towns: