An event object is always passed as the first argument to the function,
which contains the information you need.
$('#form').submit(function(event)
{
    // Get the element that fired the event
    var element = event.target;
});

For more info check out the Events guide:
http://docs.jquery.com/Events_(Guide)

-Hector


On Tue, Nov 18, 2008 at 10:47 AM, Mark Steudel <[EMAIL PROTECTED]> wrote:

>
> Hi I have a form that has two submit buttons I am utilizing the
> following ajaxSubmit code:
>
> $("#form").submit( function() {
>                $(this).ajaxSubmit({
>                    target: '#response'
>                });
>
>                return false;
>        }
> );
>
> Inside the submit function is there a way to figure out which button
> was clicked? I tried doing something like
>
> $(this).attr("id")
>
> but it gives the id of the form, not the button ....
>
> TIA

Reply via email to