diff options
| author | polo <ordipolo@gmx.fr> | 2025-06-28 10:34:25 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-06-28 10:34:25 +0200 |
| commit | ef60a4bd581ec9fb85384c6a262b499373a37d67 (patch) | |
| tree | 7ae6d4aa39cf6128a0358634b371c3ed77c3a18b /public/js | |
| parent | f60a9d046088b3bad3e97ff568fc83fecc67ccde (diff) | |
| download | cms-ef60a4bd581ec9fb85384c6a262b499373a37d67.tar.gz cms-ef60a4bd581ec9fb85384c6a262b499373a37d67.tar.bz2 cms-ef60a4bd581ec9fb85384c6a262b499373a37d67.zip | |
formulaire de contact 1
Diffstat (limited to 'public/js')
| -rw-r--r-- | public/js/form.js | 28 |
1 files changed, 28 insertions, 0 deletions
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 @@ | |||
| 1 | //function sendMessage(){} | ||
| 2 | |||
| 3 | function changeRecipient(){ | ||
| 4 | const email = document.getElementById('recipient').value; | ||
| 5 | const id_form = ''; | ||
| 6 | |||
| 7 | fetch('index.php?action=recipient_email', { | ||
| 8 | method: 'POST', | ||
| 9 | headers: { | ||
| 10 | 'Content-Type': 'application/json' | ||
| 11 | }, | ||
| 12 | body: JSON.stringify({ id_form: id_form, email: email }) | ||
| 13 | }) | ||
| 14 | .then(response => response.json()) | ||
| 15 | .then(data => { | ||
| 16 | if(data.success) | ||
| 17 | { | ||
| 18 | toastNotify('Adresse e-mail de destination modifiée'); | ||
| 19 | } | ||
| 20 | else { | ||
| 21 | |||
| 22 | console.error('Erreur: echec de la modification de l\'adresse e-mail de destination'); | ||
| 23 | } | ||
| 24 | }) | ||
| 25 | .catch(error => { | ||
| 26 | console.error('Erreur:', error); | ||
| 27 | }); | ||
| 28 | } \ No newline at end of file | ||
