jQuery submit, how can I know what submit button was pressed?

jquery, plugins, submit

Solution

$("input .button-example").click(function(){
//do something with $(this) var
});

PS: do you have jQuery controling the $ var? Otherwise you have to do this:

jQuery.noConflict();
jQuery(document).ready(function(){
    jQuery("input .button-example").click(function(){
    //do something with jQuery(this) var
       alert(jQuery(this));
    });
});

if you wan't control on event (form submit)

$(document).ready(function(){
    $("#formid").submit(function() {
          alert('Handler for .submit() called.');
          return false;
    });
});

tell me something if it worked ;)

Problem

I'm using ajaxSubmit plugin to send Ajax forms, but for some reason this plugin doesn't send names/values of `input[type=image]`'s. So now I'm catching the submit event before ajaxSubmit will handle the form and I need to know if it is possible to find out what button was pressed?

Original source