prevent default on enter keypress in IE7
<p>I'm solving the problem with default submit button in IE7. When I press "enter" key in input field, than some button on the page is clicked. So I've found the solution for this:</p>

<pre><code> $(document).bind("keypress", function(ev) {
     ev.keyCode == 13 &amp;&amp; ev.preventDefault();  
 });
</code></pre>

<p>But there is the problem with this code: textarea tag don't get "new line". So I tried this:</p>

<pre><code> $(document).bind("keypress", function(ev) {
     if (ev.keyCode == 13 &amp;&amp; ev.target.type != "textarea")
         ev.preventDefault();  
 });
</code></pre>

<p>It works but looks dirty. The question is: can you advice better solution for the Problem?</p>

<p>Thank you in advance.</p>
