SO Question

http://stackoverflow.com/q/5732555/435873 Cross-browser method of determing which button executed the submit example.

by leomwa

HTML

<form id="iDoNothing" action="/" method="POST">
    <input type="text" name="text-input-element" value="text-input-element-value" />
    <button id="submitFormBtn" name="submitFormBtn" value="submitBtnValue">Submit</button>
</form>

JavaScript

$('#submitFormBtn').bind('click', function(evt) {

    var the_form = $('#iDoNothing');
    var data = the_form.serialize();
    var url = the_form.attr('action');
    var button = $(evt.target);

    data = data + "&" + button.get(0).name + "=" + button.val();

    // post the data
    
    // using an alert window to observe the data variable...
    alert(data);
    return false;
});