title: Can't type on input box when using e.preventDefault();
body: <p>I'm trying to call a Ajax for search functionality on my website when user press enter (using keyboard) on html input box. To prevent page loading after pressing enter I'm using  <code>e.preventDefault();</code> in ajax call but then I can't type of input box. It's working fine but can't type on input box. Can you tell me what I'm doing wrong ?</p>
  
  <pre><code>$(document).keypress(function(e) {
       e.preventDefault();
  
       var value = $('#txt_name').val();
  
       if(e.which == 13) {
          $.ajax({
          type:"POST",
          url:"doSearchEnter.php",
          data:{
              'key' : value
               },
          success:function(res){
              $('#showSearchResult').html(res);
               }
         });
      }
  });
  </code></pre>