jQuery - クリック後に送信ボタンを無効にする方法

jQuery –クリック後に送信ボタンを無効にする方法

多くの場合、ユーザーは送信ボタンを数回押して、ボタンが確実にクリックされるようにし、二重フォーム送信の問題を引き起こします。 一般的な解決策は、ユーザーがクリックした後に送信ボタンを無効にすることです。

1. 送信ボタンを有効/無効にする

1.1 To disable a submit button, you just need to add a disabled attribute to the submit button.

$("#btnSubmit").attr("disabled", true);

1.2 To enable a disabled button, set the disabled attribute to false, or remove the disabled attribute.

$('#btnSubmit').attr("disabled", false);
or
$('#btnSubmit').removeAttr("disabled");

2. jQueryの完全な例





jQuery - How to disabled submit button after clicked

参考文献