defeating the enter key from doing a form submit
<p>I've found several jQuery syntaxes for nullifying the enter on a form.</p>

<p>First one:</p>

<pre><code>$("form input[@type=text]").bind("keypress", function(e) {
  var code=e.charCode || e.keyCode;
  return (code==13)?false:true;
});
</code></pre>

<p>Second one:</p>

<pre><code>$("form").bind("keypress", function(e) {
   if (e.keyCode == 13) return false;
});
</code></pre>

<p>My version:</p>

<pre><code>$('form').keypress(function(e) {
   if (e.which == 13) return false;
});
</code></pre>

<p>My question is:</p>

<p>Q: Is my version ok to use, or is there a best practice for defeating the enter key from doing a form submit?</p>
