$(form).submit(function(){
var that = $(this);
var url = that .attr('action');
var method = that .attr('method');
$.ajax({
type: method,
url: url,
data: that .serialize(),
beforesend: function(){
that.attr('disabled','true');
},
success: function(){
},
complete: function(){
that.attr('disabled','false');
}
});