malsup - ajax form

malsup - ajax form

This ia really handy plugin for me especially because it allows for file uploads via ajax.  Thanks for this malsup.

The problem I am having now is that I can't get access to the form once the submit process starts  (see code)

So I don't know if I'm doing something wrong or if the plugin isn't providing information that I'm expecting it to.

Any help? Thanks! :)

  1. $("form[name^=delete_person_]").ajaxForm({
  2.     dataType: 'json',
  3.     beforeSubmit: function(data){
  4.       console.log(  $(this).attr("name") );  // undefined even though the form has a name
  5.       console.log(  $(this) ) ;  // see below for output
  6.     },
  7.     success: function(json){}
  8. });
Firebug console:

  data

"utf8=✓&_method=...cfIOn8=&commit=Delete"
 

dataType
"json"
 

iframeSrc
"about:blank"
 

type
"post"
 

url
"/people/43006"
 

beforeSubmit
function()
 

success
function()