IMPR: Disable AJAX form buttons on submission process

This commit is contained in:
Tony Air 2023-11-21 17:15:28 +02:00
parent cd8d976e16
commit 11383ff5aa
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@a2nt/ss-bootstrap-ui-webpack-boilerplate-react",
"version": "5.1.5",
"version": "5.1.6",
"description": "This UI Kit allows you to build Bootstrap 5 webapp with some extra UI features. It's easy to extend and easy to convert HTML templates to CMS templates.",
"author": "Tony Air <tony@twma.pro>",
"license": "BSD-2-Clause",

View File

@ -12,6 +12,11 @@ const submitForm = (e) => {
console.log(`${NAME}: submit`)
const data = new FormData(form);
const parent = form.parentElement;
const btns = form.querySelectorAll('input[type="submit"],button')
btns.forEach(el => {
el.setAttribute('disabled', 'disabled')
})
data.append('ajax', '1')
form.classList.add('loading')