summaryrefslogtreecommitdiff
path: root/public/js/form.js
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2025-06-30 17:22:26 +0200
committerpolo <ordipolo@gmx.fr>2025-06-30 17:22:26 +0200
commitea3eaf84c6de3f96d6bb73e817147f8571fd6c1f (patch)
treea1a27445fd758c16bbb15baa1830118a4f01eca1 /public/js/form.js
parentef60a4bd581ec9fb85384c6a262b499373a37d67 (diff)
downloadcms-ea3eaf84c6de3f96d6bb73e817147f8571fd6c1f.zip
formulaire de contact 2
Diffstat (limited to 'public/js/form.js')
-rw-r--r--public/js/form.js15
1 files changed, 7 insertions, 8 deletions
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 @@
1//function sendMessage(){} 1//function sendMessage(){}
2 2
3function changeRecipient(){ 3function changeRecipient(id){
4 const email = document.getElementById('recipient').value; 4 const email = document.getElementById('recipient').value;
5 const id_form = ''; 5 const warning = document.querySelector('.no_recipient_warning');
6 6
7 fetch('index.php?action=recipient_email', { 7 fetch('index.php?action=recipient_email', {
8 method: 'POST', 8 method: 'POST',
9 headers: { 9 headers: {
10 'Content-Type': 'application/json' 10 'Content-Type': 'application/json'
11 }, 11 },
12 body: JSON.stringify({ id_form: id_form, email: email }) 12 body: JSON.stringify({ id: id, email: email })
13 }) 13 })
14 .then(response => response.json()) 14 .then(response => response.json())
15 .then(data => { 15 .then(data => {
16 if(data.success) 16 if(data.success){
17 { 17 warning.classList.add('hidden');
18 toastNotify('Adresse e-mail de destination modifiée'); 18 toastNotify('Adresse e-mail de destination modifiée');
19 } 19 }
20 else { 20 else{
21
22 console.error('Erreur: echec de la modification de l\'adresse e-mail de destination'); 21 console.error('Erreur: echec de la modification de l\'adresse e-mail de destination');
23 } 22 }
24 }) 23 })