Created
August 21, 2014 06:34
-
-
Save RyoSugimoto/f859fc4641c0520b5fa9 to your computer and use it in GitHub Desktop.
Enter/Returnキーによるサブミットを無効化するjQueryプラグイン。
This file contains hidden or 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 (window, document, $) { | |
$.fn.cancelSubmit = function() { | |
return this.each(function () { | |
$(this) | |
.find(':text').on('keypress', function (e) { | |
if (e.keyCode === 13) { | |
e.preventDefault(); | |
} | |
}); | |
}); | |
}; | |
}(window, document, jQuery, undefined)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment