using live for form submit
$("form").live("submit", function() {
$('input:submit').attr("disabled", "disabled");
$('input:submit').addClass("disabled");
});

this code is to disabled the button and add disabled class to it.
problem: This is not working with jquery ui dialogs. It disabled the button before the form submitted so button params = nill

Solution: So i am using delay. so come up with something like this

//disbale submit buttons using live for fly elements
$('input:submit').live('click', function(e) {
$(this).addClass("disabled");
// dealy to fix popup problem
function setDelayed(jqObj, to) { setTimeout(function() {jqObj.attr("disabled", "disabled");}, to); }
setDelayed($(this), 1);
});

Best practice is to use asynchronies false
$.ajaxSetup({
async: false
});

By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests anddataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active.