如何在单击时禁用提交按钮并在jquery表单插件中重新启用响应

i want to be able to make the submit button in jquery form plugin disabled and then when the response is retrieved, it should become enable. i am trying thru the code below but as soon as in the onlick event i disabled the button it somehow stops the submission. although i am able to change the class of the button.

what am i doing wrong?

code is like this:

function timing(){
 d=Math.round(new Date().getTime() / 1000);
 $('input[name=timedate]').val(d);
 var btn1 = $('#post_global');  
 btn1.val('posting');
 btn1.removeClass('t_s').addClass('t_sDisabled');
 btn1.prop('disabled',true);    
  }

 (function() {
 $('form').ajaxForm({
dataType: 'json', 
beforeSubmit: validate,
success: processResponse

}); 
  })();  

 function processResponse(data) {
  document.getElementById('upfile').value = "";
  document.getElementById('fileinfo').innerHTML = "";
  document.getElementById('txt1').value="post anything...";
   var status = $('#status');   
if(data.errors == ""){
    status.hide().html(data.htmlResponse).fadeIn(1000);
} else{
alert(data.errors);
    }
var btn2 = $('#post_global');   
btn2.val('post');
btn2.removeClass('t_sDisabled').addClass('t_s');    
btn2.prop('disabled',false);
  }

This is the answer that I think you're looking for. If you want more, just comment what you want below:

$("#btn2").click(function() {
$('#btn2').attr("disabled", true);
//Do the request here
$('#btn2').attr("disabled", false);}

Possibly this?

function timing(){
 d=Math.round(new Date().getTime() / 1000);
 $('input[name=timedate]').val(d);
 var btn1 = $('#post_global');  
 btn1.val('posting');
 $('#btn2').attr("disabled", true);
  }

 (function() {
 $('form').ajaxForm({
dataType: 'json', 
beforeSubmit: validate,
success: processResponse

}); 
  })();  

 function processResponse(data) {
  document.getElementById('upfile').value = "";
  document.getElementById('fileinfo').innerHTML = "";
  document.getElementById('txt1').value="post anything...";
   var status = $('#status');   
if(data.errors == ""){
    status.hide().html(data.htmlResponse).fadeIn(1000);
} else{
alert(data.errors);
    }
var btn2 = $('#post_global');   
btn2.val('post');
$('#btn2').attr("disabled", false);
  }