CZ
EN
VN
Country selection
Client's Briefs
Partners
Careers
Country selection
CZ
EN
VN
Homepage
Services
Categories
Buyer’s Inquiry
About us
Contact
Contact
+ 420 602 122 819
hello@ppgcz.com
Name
Email
Phone number
Message
// 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 🍦
Your inquiry has been successfully sent! Our team will contact you within 24 hours.
Něco je špatně. Zkontrolujte formulář.