title: jQuery live preventDefault failing on input elements
body: <p>I have the following snippet of code:</p>
  
  <pre><code>$('#messages input').live('keydown', function(e){
    if(e.keyCode == 13) {
      alert($(this).attr('value'));
      e.preventDefault();
      return false;
    }
  });
  </code></pre>
  
  <p>where "#message input" is obviously a group of input text elements. I want to catch the "enter" key and prevent it from refreshing the page. However, it fails every time. The alert works fine, but it seems that the preventDefault() isn't working.</p>
  
  <p>Anyone have any ideas?</p>
  
  <p><strong>Edit:</strong> I should have mentioned that I'm working in ASP.NET, and it's inside a form element. Removing it from the form element solves the problem, but I'd like to know why preventDefault() isn't working.</p>