diff --git a/templates/_js.tpl b/templates/_js.tpl index 53b96d5..8bffb35 100644 --- a/templates/_js.tpl +++ b/templates/_js.tpl @@ -43,7 +43,11 @@ g.toggle('.type_' + type, true); } - changeTypeSaisie(document.forms[0].base_receveur.value); + const form = document.querySelector('#f_numero_facture').form; + + if (form.base_receveur) { + changeTypeSaisie(form.base_receveur.value); + } var inputs = $('input[name="base_receveur"]'); @@ -83,7 +87,6 @@ g.toggle(e, true); g.toggle('p.submit', true); }); - console.log(e.value); selectType(e.value); }; }); diff --git a/templates/facture_ajouter.tpl b/templates/facture_ajouter.tpl index dfa4f4c..7ad46c6 100644 --- a/templates/facture_ajouter.tpl +++ b/templates/facture_ajouter.tpl @@ -65,16 +65,19 @@ {input type="radio" name="base_receveur" value="client" label="Un·e client·e"} {/if} - +
{input type="select" name="membre" label="Membre" options=$membres required=1}
- - {if !empty($clients)} -
- {input type="select" name="client" label="Client" options=$clients required=1 class="type_client"} -
- {/if} + + {if !empty($clients)} +
+ {input type="select" name="client" label="Client" options=$clients required=1 class="type_client"} +
+ {else} + + {/if} +