KeyCode

</head>
<script type="text/javascript">
function getKey(e)
  {
  if((parseInt(e.keyCode,10)<58 && parseInt(e.keyCode,10)>47) || parseInt(e.keyCode,10)==190 || parseInt(e.keyCode,10)==8)
  {
  return true;
  }
  else return false;
  }

</script>
</head>
<body>
<input type="text" onkeydown="return getKey(event);" />
<input type="button" value="something" onClick="document.location.href='http://www.google.com';">
</body>