Fix JS pour la sélection client/membre dans le formulaire d'ajout
This commit is contained in:
parent
fcbcd813df
commit
4fb4c9025c
@ -40,14 +40,14 @@
|
||||
function changeTypeSaisie(type)
|
||||
{
|
||||
g.toggle(['.type_client', '.type_membre'], false);
|
||||
g.toggle('.type_' + type, true);
|
||||
|
||||
if (type) {
|
||||
g.toggle('.type_' + type, true);
|
||||
}
|
||||
}
|
||||
|
||||
const form = document.querySelector('#f_numero_facture').form;
|
||||
|
||||
if (form.base_receveur) {
|
||||
changeTypeSaisie(form.base_receveur.value);
|
||||
}
|
||||
changeTypeSaisie(form.base_receveur.value);
|
||||
|
||||
var inputs = $('input[name="base_receveur"]');
|
||||
|
||||
|
@ -58,27 +58,26 @@
|
||||
<legend>Client</legend>
|
||||
|
||||
<dl>
|
||||
<dt><label>Document adressée à :</label></dt>
|
||||
<dt><label>Document adressé à :</label></dt>
|
||||
{if !empty($clients)}
|
||||
<dd>
|
||||
{input type="radio" name="base_receveur" value="membre" label="Un·e membre" default=1}
|
||||
{input type="radio" name="base_receveur" value="client" label="Un·e client·e"}
|
||||
</dd>
|
||||
{/if}
|
||||
<dd>
|
||||
<div class="type_membre">
|
||||
{input type="select" name="membre" label="Membre" options=$membres required=1}
|
||||
</div>
|
||||
|
||||
{if !empty($clients)}
|
||||
<div class="type_client">
|
||||
{input type="select" name="client" label="Client" options=$clients required=1 class="type_client"}
|
||||
</div>
|
||||
{else}
|
||||
<input type="hidden" name="base_receveur" value="membre" />
|
||||
{/if}
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl class="type_membre">
|
||||
{input type="select" name="membre" label="Membre" options=$membres required=1}
|
||||
</dl>
|
||||
|
||||
{if !empty($clients)}
|
||||
<dl class="type_client">
|
||||
{input type="select" name="client" label="Client" options=$clients required=1 class="type_client"}
|
||||
</dl>
|
||||
{else}
|
||||
<input type="hidden" name="base_receveur" value="membre" />
|
||||
{/if}
|
||||
</fieldset>
|
||||
|
||||
<fieldset data-types="t0 t1 t2">
|
||||
|
Loading…
Reference in New Issue
Block a user