From ef60a4bd581ec9fb85384c6a262b499373a37d67 Mon Sep 17 00:00:00 2001 From: polo Date: Sat, 28 Jun 2025 10:34:25 +0200 Subject: formulaire de contact 1 --- public/js/form.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 public/js/form.js (limited to 'public/js') diff --git a/public/js/form.js b/public/js/form.js new file mode 100644 index 0000000..6386ea8 --- /dev/null +++ b/public/js/form.js @@ -0,0 +1,28 @@ +//function sendMessage(){} + +function changeRecipient(){ + const email = document.getElementById('recipient').value; + const id_form = ''; + + fetch('index.php?action=recipient_email', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ id_form: id_form, email: email }) + }) + .then(response => response.json()) + .then(data => { + if(data.success) + { + toastNotify('Adresse e-mail de destination modifiée'); + } + else { + + console.error('Erreur: echec de la modification de l\'adresse e-mail de destination'); + } + }) + .catch(error => { + console.error('Erreur:', error); + }); +} \ No newline at end of file -- cgit v1.2.3