Ajout champ contact à la fiche client

This commit is contained in:
Jean-Christophe Engel 2025-03-25 20:49:24 +01:00
parent aff20099aa
commit 4aafa3f44f
12 changed files with 47 additions and 7 deletions

View file

@ -51,6 +51,18 @@
}
}
function modifierContact(client, idlist, idcontact)
{
let contactlist = document.querySelector(idlist);
let options = contactlist.querySelectorAll('option');
for (i=0; i < options.length; ++i) {
if (options[i].value == client.value) {
break;
}
}
document.querySelector(idcontact).value = options[i].textContent;
}
const form = document.querySelector('#f_numero_facture').form;
changeTypeSaisie(form.base_receveur.value);
@ -63,6 +75,11 @@
};
}
const selclient = document.querySelector('#f_client');
selclient.addEventListener("change", () => {
modifierContact(selclient, '#f_contact_list', '#f_nom_contact');
});
} ());