HTML Wyłącz przesyłanie, dopóki wszystkie wymagane pole nie zostanie zakończone
<!-- HTML inputs -->
<input class="input required" type="text" placeholder="fill me">
<input class="input" type="text" placeholder="fill me">
<input class="input required" type="text" placeholder="fill me">
<button class="button">Click Me</button>
<!-- Js -->
let inputs = document.querySelectorAll('.required'),
button = document.querySelector('.button');
button.disabled = true;
for (i = 0; i < inputs.length; i++) {
inputs[i].addEventListener('input',() => {
let values = []
inputs.forEach(v => values.push(v.value))
button.disabled = values.includes('')
})
}
Clever Cassowary