Created
January 9, 2014 03:33
-
-
Save tikitikipoo/8328981 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(win, doc, $) { | |
"use strict"; | |
$(function(){ | |
// フォーム多重送信防止処理 | |
// | |
// ※全てのフォームに適用ではなく、「設定した」フォームに適用する方針で実装する | |
// *POSTでの遷移が多いため、ブラウザバックで戻った際、意図してない動作が発生すると推測したため | |
// | |
// 設定方法 | |
// 多重送信を防止したいフォームタグにnoMultiplePostをclassに付与 | |
// 多重送信を防止したいsubmitボタンにnoMultiplePostをclassに付与 | |
// | |
$('form.noMultiplePost').on('submit', function() { | |
$(this).find('input[type=submit].noMultiplePost').attr("disabled", true) | |
// エンター用に | |
$(this).on('submit', function() { | |
return false; | |
}); | |
}); | |
}); | |
})(window, document, jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment