Click closest submit button when any 'enter' key event occurs on any input field
<p>I have multiple submit button on the page. What I want is if user presses enter on any input field it should click the related submit button. I tried the way below but it even couldnt catch the key press on the input fields. </p>

<p>Thanks in advance,  </p>

<pre><code>$('* input').keypress(function (e) {

      if ((e.which &amp;&amp; e.which == 13) || (e.keyCode &amp;&amp; e.keyCode == 13)) {
            $(this).closest('input[type=submit]').click();

      }
});
</code></pre>
