title: jQuery: how to get which button was clicked upon form submission?
body: <p>I have a <code>.submit()</code> event set up for form submission.  I also have multiple forms on the page, but just one here for this example.  I'd like to know which submit button was clicked without applying a <code>.click()</code> event to each one.</p>
  
  <p>Here's the setup:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;jQuery research: forms&lt;/title&gt;
    &lt;script type='text/javascript' src='../jquery-1.5.2.min.js'&gt;&lt;/script&gt;
    &lt;script type='text/javascript' language='javascript'&gt;
        $(document).ready(function(){
            $('form[name="testform"]').submit( function(event){ process_form_submission(event); } );
        });
        function process_form_submission( event ) {
            event.preventDefault();
            //var target = $(event.target);
            var me = event.currentTarget;
            var data = me.data.value;
            var which_button = '?';       // &lt;-- this is what I want to know
            alert( 'data: ' + data + ', button: ' + which_button );
        }
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h2&gt;Here's my form:&lt;/h2&gt;
  &lt;form action='nothing' method='post' name='testform'&gt;
    &lt;input type='hidden' name='data' value='blahdatayadda' /&gt;
    &lt;input type='submit' name='name1' value='value1' /&gt;
    &lt;input type='submit' name='name2' value='value2' /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><a href="http://jsfiddle.net/fKppt/">Live example on jsfiddle</a></p>
  
  <p>Besides applying a .click() event on each button, is there a way to determine which submit button was clicked?</p>