title: how to disable the function of ESC key in JavaScript?
body: <p>In my chat application there are some text fields which gets the user login details.</p>
  
  <p>when filling the user details,If user suddenly pressed the ESC key,the data will be lost.</p>
  
  <p>I need to disable the function of ESC key ? which event I need to use ? how can I do that.</p>
  
  <p>my Java Script code is ,</p>
  
  <pre><code>function esc(e){
      e = e || window.event || {};
      var charCode = e.charCode || e.keyCode || e.which;
      if(charCode == 27){
      return false;
      }
  }
  </code></pre>
  
  <p>Searched a lot in Stack overflow and google.Nothing worked.Please any one help me to do that . Thanks..</p>