1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【jQuery】フォームの二重送信の防止

Posted at

一度押したボタンは押せないようにします。
以下を追加するだけ!

簡単ですね。

一度押したボタンを押せないようにしています。
リロードしたらもとに戻ります。

$(function(){
    $('input[type="submit"]').on('click', function(){
        $(this).prop('disabled', true);
        $(this).closest('form').submit();
    });
});
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?