Files
sgl/static/js/detail_gestion_vehicule.js
2025-12-19 09:43:33 +00:00

24 lines
1012 B
JavaScript

// document.getElementById("id_mois_concerne").addEventListener("change", function () {
// fetch(`/gestion-produit/recuperer-fournisseur-categorie/${this.value}`)
// .then(response => response.json())
// .then(data => {
// champs_fournisseur.innerHTML = "";
// data.forEach(fournisseur => {
// const option = document.createElement("option");
// option.value = fournisseur.id;
// option.text = fournisseur.nom_fournisseur;
// champs_fournisseur.appendChild(option);
// });
// })
// })
carnetBordMois = document.querySelector("#carnetBordForm #id_mois_concerne");
carnetBordMois.addEventListener("change", function () {
fetch (`/gestion-vehicule/carnet-vehicule-information/${carnetBordMois.value}`)
.then(response => response.json())
.then(data => {
document.getElementById("id_km_debut_mois").value = data.km_debut;
document.getElementById("id_km_fin_mois").value = data.km_fin;
})
})