From ea3eaf84c6de3f96d6bb73e817147f8571fd6c1f Mon Sep 17 00:00:00 2001 From: polo Date: Mon, 30 Jun 2025 17:22:26 +0200 Subject: formulaire de contact 2 --- public/css/body.css | 4 ++++ public/css/tinymce.css | 4 ++-- public/js/form.js | 15 +++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) (limited to 'public') diff --git a/public/css/body.css b/public/css/body.css index a2b099a..eb198e6 100644 --- a/public/css/body.css +++ b/public/css/body.css @@ -7,6 +7,10 @@ body background-color: #0cceec; } +.hidden{ + display: none; +} + #bloc_page {} diff --git a/public/css/tinymce.css b/public/css/tinymce.css index 55639e0..1a99de9 100644 --- a/public/css/tinymce.css +++ b/public/css/tinymce.css @@ -1,6 +1,6 @@ .tox-promotion{ display: none; } -.hidden{ +/*.hidden{ display: none; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/public/js/form.js b/public/js/form.js index 6386ea8..1752f55 100644 --- a/public/js/form.js +++ b/public/js/form.js @@ -1,24 +1,23 @@ //function sendMessage(){} -function changeRecipient(){ +function changeRecipient(id){ const email = document.getElementById('recipient').value; - const id_form = ''; + const warning = document.querySelector('.no_recipient_warning'); fetch('index.php?action=recipient_email', { method: 'POST', headers: { - 'Content-Type': 'application/json' + 'Content-Type': 'application/json' }, - body: JSON.stringify({ id_form: id_form, email: email }) + body: JSON.stringify({ id: id, email: email }) }) .then(response => response.json()) .then(data => { - if(data.success) - { + if(data.success){ + warning.classList.add('hidden'); toastNotify('Adresse e-mail de destination modifiée'); } - else { - + else{ console.error('Erreur: echec de la modification de l\'adresse e-mail de destination'); } }) -- cgit v1.2.3