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/css/form.css | 54 +++++++++++++++++++++++++++++++++++++++++++++++ public/css/modif_page.css | 4 ++-- public/js/form.js | 28 ++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 public/css/form.css create mode 100644 public/js/form.js (limited to 'public') diff --git a/public/css/form.css b/public/css/form.css new file mode 100644 index 0000000..473252c --- /dev/null +++ b/public/css/form.css @@ -0,0 +1,54 @@ +.form form{ + background-color: white; + margin: auto; + padding: 10px; + max-width: 800px; + display: grid; + grid-template-columns: auto 1fr; + gap: 10px; + align-items: center; /* vertical */ +} +.form label{ + text-align: right; +} +.form .full_width_column{ + grid-column: 1 / span 2; +} +.form form input[type=submit] +{ + color: #ff1d04; + font-size: medium; + border-radius: 4px; + background-color: white; + border: lightgrey 2px outset; +} +.form form input[type=submit]:hover +{ + background-color: #ffff00; + border-radius: 4px; + cursor: pointer; +} + +.no_recipient_warning{ + color: red; + text-align: center; +} + +.form .admin_form{ + background-color: #f0f0f0; + margin: auto; + padding: 10px; + max-width: 800px; +} + +@media screen and (max-width: 600px){ + .form form{ + grid-template-columns: 1fr; + } + .form label{ + text-align: left; + } + .form .full_width_column { + grid-column: 1; + } +} \ No newline at end of file diff --git a/public/css/modif_page.css b/public/css/modif_page.css index d743e9e..77392d2 100644 --- a/public/css/modif_page.css +++ b/public/css/modif_page.css @@ -13,10 +13,10 @@ background-color: white; border: lightgrey 2px outset; } -.page_modificationselect:hover +/*.page_modification select:hover { cursor: pointer; -} +}*/ .page_modification form input[type=submit]:hover { background-color: #ffff00; 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