吊炸天的阿旺

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

//jQuery

<script type="text/javascript">
$("input:submit").each(function() {
var srcclick = $(this).attr("onclick");
if(typeof(srcclick)=="function"){
$(this).click(function() {
if (srcclick()) {
setdisabled(this);
return true;
}
return false;
});}
});
function setdisabled(obj) {
setTimeout(function() { obj.disabled = true; }, 100);
}
</script>

  function disableOtherSubmit()
    {
        $("input:submit").each(function(i) {
        setTimeout(function() { $("input:submit").eq(i).attr("disabled","true"); }, 100); });
    }
//ASP.NET
  Button_All.Attributes.Add("onclick", "this.disabled=true;" + this.ClientScript.GetPostBackEventReference(Button_All, ""));
            Button_CurrentCount.Attributes.Add("onclick", "this.disabled=true;" + this.ClientScript.GetPostBackEventReference(Button_CurrentCount, ""));
            Button_Between.Attributes.Add("onclick", "this.disabled=true;" + this.ClientScript.GetPostBackEventReference(Button_Between, ""));

posted on 2010-08-23 14:25  吊炸天的阿旺  阅读(678)  评论(3编辑  收藏  举报