authorize: delay form submission by 800ms
This commit is contained in:
parent
fa2d42e5da
commit
3a6092ce4f
1 changed files with 5 additions and 1 deletions
|
|
@ -77,8 +77,12 @@
|
||||||
* @param {string} formId
|
* @param {string} formId
|
||||||
*/
|
*/
|
||||||
function disableSubmitButtonForm(formId) {
|
function disableSubmitButtonForm(formId) {
|
||||||
document.getElementById(formId).addEventListener("submit", (event => {
|
const form = document.getElementById(formId);
|
||||||
|
|
||||||
|
form.addEventListener("submit", (event => {
|
||||||
|
event.preventDefault();
|
||||||
event.submitter.classList.add("btn-loading");
|
event.submitter.classList.add("btn-loading");
|
||||||
|
setTimeout(() => form.submit(), 800)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue