dialog buttons - passing button name

dialog buttons - passing button name

 Hi,

I am trying to get button name from the link "name' tag.  The original button is:

  1. 'Save':  function() {
                        $('#linkForm').submit();
                            $(this).dialog('close');                   
                    }



and I am trying something like this:
  1. $link.attr('name'):  function() {
                        $('#linkForm').submit();
                            $(this).dialog('close');                   
                    },



I am getting errors, how can I accomplish this?