formulaire ok pour tout sauf btn modifier

This commit is contained in:
2026-07-05 18:21:13 +00:00
parent 9865c17ac8
commit c252d648b8
3 changed files with 173 additions and 23 deletions
+27
View File
@@ -45,3 +45,30 @@ document.addEventListener("DOMContentLoaded", () => {
}
});
});
// Dans js/ordreGF.js
window.ouvrirModalCreation = function (masterId) {
// Optionnel : stocker l'ID dans un champ caché de votre formulaire
let inputHidden = document.getElementById("Id_entete_hidden");
if (inputHidden) inputHidden.value = masterId;
document.getElementById("modalCreerOrdre").showModal();
};
document
.getElementById("formCreerDetail")
.addEventListener("submit", async (e) => {
e.preventDefault();
const formData = new FormData(e.target);
const response = await fetch("/php/api_enregistrer_detail.php", {
method: "POST",
body: formData,
});
if ((await response.json()).success) {
location.reload();
} else {
alert("Erreur lors de l'enregistrement du détail");
}
});