jQuery and ASP.NET - forcing button click
<p>I have a ASP.NET page which has a form on it. It also has a search form on it. The search is in the top-right of the page, so the button for the search is the first added to the control hierachy.</p>

<p>When you're working on the other form and press enter it will click on the search button. I don't want this, I would prefer that when you press enter the button for the form is clicked.</p>

<p>I tried using jQuery like this:</p>

<pre><code>$('#textBoxId').keyup(function(e) {
  if(e.keyCode === 13) { 
    $('#buttonId').click();
    e.preventDefault();
  }
});
</code></pre>

<p>But the form submitted, meaning that the client-side validation didn't run (ie, the onclick event handler wasn't run on the button).</p>

<p>What's the best way to achieve this?</p>
