You are here: irt.org | FAQ | JavaScript | Form | Q1394 [ previous next ]
Try:
<html> <head> <title>Untitled</title> <script language="JavaScript"><!-- function handler(e) { var key = (navigator.appName == "Netscape") ? e.which : e.keyCode; if (key == 13 || key == 46 || (key > 47 && key < 58)) return true; else return false; } //--></script> </head> <body> <form> <input type="text" onKeyDown="return handler(event)" onKeydown="return handler(event)"> </form> </body> </html>