我是靠谱客的博主 美丽大船,这篇文章主要介绍jquery提交form表单时禁止重复提交的方法,现在分享给大家,希望可以做个参考。

复制代码 代码如下:

$(document).ready(function() {
  $('form').submit(function() {
    if(typeof jQuery.data(this, "disabledOnSubmit") == 'undefined') {
      jQuery.data(this, "disabledOnSubmit", { submited: true });
      $('input[type=submit], input[type=button]', this).each(function() {
        $(this).attr("disabled", "disabled");
      });
      return true;
    }
    else
    {
      return false;
    }
  });
});

最后

以上就是美丽大船最近收集整理的关于jquery提交form表单时禁止重复提交的方法的全部内容,更多相关jquery提交form表单时禁止重复提交内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(240)

评论列表共有 0 条评论

立即
投稿
返回
顶部