title: JavaScript is not working in FF browser
body: <p>I have the following JavaScript code:</p>
  
  <pre><code>/* Only numbers input in the CELL text box */
  function ValidateKeyNumber() 
  {   
      var key=window.event.keyCode;
      var allowed='0123456789';
  
      return allowed.indexOf(String.fromCharCode(key)) !=-1 ;
  }
  </code></pre>
  
  <p>This JS working fine in IE &amp; Chrome but not in FF.  Can you please tell me what is wrong with this? I need the JS to work in these 3 major browsers.</p>
  
  <p>FYI:</p>
  
  <ol>
  <li>I use the latest FF version.</li>
  <li>JavaScript is enabled in FF.</li>
  <li>I don't use jQuery</li>
  </ol>
  
  <p>Any help will be appreciated.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p><em><strong>FULL PAGE CODE:</em></strong></p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
  &lt;title&gt;JavaSCript Input Test&lt;/title&gt;
  &lt;script&gt;
  /* Only numbers in mobile text-box */
  function ValidateKeyNumber() 
  {   
      var key=window.event.keyCode;
      var allowed='0123456789';
  
      return allowed.indexOf(String.fromCharCode(key)) !=-1 ;
  }
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;form&gt;
  &lt;label&gt;Cell Number:&lt;/label&gt;&lt;input type="text" name="cell" size="30" maxlength="10" onKeyPress="return ValidateKeyNumber()"/&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>