Arroc in a white ball

Kontakt

// on document ready document.addEventListener("DOMContentLoaded", event => { // define form element let form = document.getElementById("formElement"); console.log(form); // define submit button let submitButton = document.getElementById("submitButton"); console.log(submitButton); // on button click submitButton.addEventListener("click", event => { console.log("button clicked"); // prevent the form from being sent event.preventDefault(); // disable empty inputs 🧠 disableEmptyInputs(); // submit cleaned form //form.submit(); // for development only setTimeout(function() { form.submit(); }, 1000); }); }); // disableEmptyInputs() declaration function disableEmptyInputs() { // create an array of all targeted inputs let inputs = document.getElementsByClassName("inputsField"); // for every input of the array for (let i = 0; i < inputs.length; i++) { let input = inputs[i]; // check if the input value is empty or null if (input.value === "" || null) { // disable empty input input.disabled = true; console.log(input); } // end of if statement } // end of for loop } // end of disableEmptyInputs() declaration // go get an 🍦
Vaše poptávka byla úspěšně odeslána! Náš tým vás bude kontaktovat do 24 hodin.
Něco je špatně. Zkontrolujte formulář.