Last active
September 14, 2021 00:53
-
-
Save ryu1/a5c925e9abf38eea98edf8cf67f3e537 to your computer and use it in GitHub Desktop.
javascript code to prevent multiple form submission for django
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
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