codice:
<?xml version="1.0" encoding="iso-8859-1"?>

  <!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
      <title>Code Example by DYNAMIC+</title>

      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <meta http-equiv="Content-Language" content="en-us" />

      <script type="text/javascript">
      <!--

        window.onload = function( )
        {
          document.forms[0].elements[0].onkeydown = function( __objEvent )
          {
            var _k = __objEvent ? __objEvent.which : window.event.keyCode;
            var _s = __objEvent ? __objEvent.modifiers & __objEvent.SHIFT_MASK : window.event.shiftKey;

            if ( _k == 8 || _k == 13 || _k == 46 || 
                 ( !_s && _k >= 48 && _k <= 57 ) ||
                 ( _k >= 37 && _k <= 40 ) || 
                 ( _k >= 96 && _k <= 105 ) )
              return true;

            else
              return false; /* adapt here for mozilla/opera */

          }
        }

      //-->
      </script>

    </head>
    <body>

      


        <form>
          Digita solo numeri:
          <input type="text" />
        </form>
      </p>

    </body>
  </html>