From f7e761e1c85ce142d4dede75670b5b618e34a205 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Mon, 28 Oct 2019 16:49:50 -0500 Subject: [PATCH] Issue #3050 - Disable submits on form submit To prevent spamming the button and filing lots of bugs. --- webcompat/static/js/lib/bugform.js | 2 ++ webcompat/static/js/lib/issue-wizard-bugform.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/webcompat/static/js/lib/bugform.js b/webcompat/static/js/lib/bugform.js index bc02e1e2b..6e60da1b1 100644 --- a/webcompat/static/js/lib/bugform.js +++ b/webcompat/static/js/lib/bugform.js @@ -605,6 +605,8 @@ BugForm.prototype.hideLoadingIndicator = function() { }; BugForm.prototype.onFormSubmit = function(event) { + event.preventDefault(); + this.disableSubmits(); this.showLoadingIndicator(); this.maybeUploadImage(event).then( this.submitForm.bind(this), diff --git a/webcompat/static/js/lib/issue-wizard-bugform.js b/webcompat/static/js/lib/issue-wizard-bugform.js index 5aec83c16..6433e17a6 100644 --- a/webcompat/static/js/lib/issue-wizard-bugform.js +++ b/webcompat/static/js/lib/issue-wizard-bugform.js @@ -1152,6 +1152,8 @@ BugForm.prototype.hideLoadingIndicator = function() { }; BugForm.prototype.onFormSubmit = function(event) { + event.preventDefault(); + this.disableSubmits(); this.showLoadingIndicator(); this.maybeUploadImage(event).then( this.submitForm.bind(this),