title: event.keycode on Javascript
body: <p>I'm working with a web page containing a form with a textarea element.  I want to restrict the input values to only numbers, using JavaScript.  One method I have found is to check the keyvalues when users are entering data:</p>
  <pre><code>function checkForEnter() {
  if (!((event.keyCode &gt;= 48) || (event.keyCode &lt;= 57))) {                            
  //event.stopPropagation(); throw error with IE ver 8
  event.cancelBubble = true;
  event.returnValue = false;
  return false;
                      
    }
  }
  </code></pre>
  <p>What other method could I use to restrict the values entered?</p>