authorize: disable html submit button on click
This commit is contained in:
parent
a32d6b4807
commit
fa2d42e5da
1 changed files with 15 additions and 1 deletions
|
|
@ -24,7 +24,7 @@
|
|||
<h2 class="h2">Access {{ app_name }}</h2>
|
||||
<p class="text-muted">With your {{ business_name }} account</p>
|
||||
</div>
|
||||
<form action="" method="post" autocomplete="off" novalidate class="mt-4">
|
||||
<form id="authorize_form" action="" method="post" autocomplete="off" novalidate class="mt-4">
|
||||
{% if user %}
|
||||
<div class="mb-4 text-center">
|
||||
{{ user::avatar(username=user.username, name=user.name, size="xl", css="mb-3") }}
|
||||
|
|
@ -71,5 +71,19 @@
|
|||
<!-- Tabler Core -->
|
||||
<script src="/js/tabler.min.js" defer></script>
|
||||
<script src="/js/demo.min.js" defer></script>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* @param {string} formId
|
||||
*/
|
||||
function disableSubmitButtonForm(formId) {
|
||||
document.getElementById(formId).addEventListener("submit", (event => {
|
||||
event.submitter.classList.add("btn-loading");
|
||||
}));
|
||||
}
|
||||
|
||||
disableSubmitButtonForm("authorize_form");
|
||||
</script>
|
||||
|
||||
</body>
|
||||
{% endblock page %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue