From ef68a7531948150e3faf645ef5ff3fe61e3c0da9 Mon Sep 17 00:00:00 2001 From: Amandine Arias Date: Mon, 10 May 2021 19:04:15 +0200 Subject: [PATCH] refactor (modal) : recup form inputs values in log (#7) --- js/contact.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/js/contact.js b/js/contact.js index 2d63f3c..850ed21 100644 --- a/js/contact.js +++ b/js/contact.js @@ -39,19 +39,9 @@ closeModalBtn.forEach((btn) => ) ); -// CONFIRMATION D'ENVOI DU MESSAGE -form.addEventListener('submit', function (e) { - if (checkValidity) { - modalBody.style.display = 'none'; - confirm.style.opacity = '1'; - form.reset(); - } -}); - // VERIFICATION DES SAISIES const inputs = document.querySelectorAll('input'); const textarea = document.querySelectorAll('textarea'); -console.log(textarea.value); const checkValidity = (input) => { input.addEventListener('invalid', (e) => { @@ -95,12 +85,7 @@ const dataSuccess = (input, message) => { small.innerText = message; }; -// recuperation des saisies -Array.from(inputs).forEach(checkValidity); -Array.from(textarea).forEach(checkValidity); - // AFFICHE LES SAISIES DANS LA CONSOLE -// ---------- NE FONCTIONNE PAS ---------- // form.addEventListener('submit', function (e) { e.preventDefault(); console.log(`Prénom : ${firstName.value}`);