Skip to content

Instantly share code, notes, and snippets.

@ryu1
Last active September 14, 2021 00:53
Show Gist options
  • Save ryu1/a5c925e9abf38eea98edf8cf67f3e537 to your computer and use it in GitHub Desktop.
Save ryu1/a5c925e9abf38eea98edf8cf67f3e537 to your computer and use it in GitHub Desktop.
javascript code to prevent multiple form submission for django
window.addEventListener("load", function() {
(function ($) {
$(function () {
$('form').submit(function () {
$(this).find('input[type="submit"], button[type="submit"]').prop('disabled', 'true');
});
});
})(django.jQuery);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment