forked from DGNum/gestioCOF
Merge branch 'Aufinal/freeze_transferts' into 'k-fet'
Fix un freeze dans l'écran de tranfert Vide l'input caché lorsque le trigramme correspondant est effacé ; effacer une ligne de transfert n'empêche plus de valider le groupe. Note : ne fonctionne pas sur la première ligne ; à cause de la façon dont django gère le nombre minimal de forms, celle ci doit toujours être remplie. Fix #98 See merge request !118
This commit is contained in:
commit
17f2202f0e
1 changed files with 13 additions and 10 deletions
|
@ -34,12 +34,12 @@
|
||||||
<tr class="transfer_form" id="{{ form.prefix }}">
|
<tr class="transfer_form" id="{{ form.prefix }}">
|
||||||
<td class="from_acc_data"></td>
|
<td class="from_acc_data"></td>
|
||||||
<td class="from_acc">
|
<td class="from_acc">
|
||||||
<input type="text" name="from_acc" class="input_from_acc" autocomplete="off" spellcheck="false">
|
<input type="text" name="from_acc" class="input_from_acc" maxlength="3" autocomplete="off" spellcheck="false">
|
||||||
{{ form.from_acc }}
|
{{ form.from_acc }}
|
||||||
</td>
|
</td>
|
||||||
<td class="amount">{{ form.amount }}</td>
|
<td class="amount">{{ form.amount }}</td>
|
||||||
<td class="to_acc">
|
<td class="to_acc">
|
||||||
<input type="text" name="to_acc" class="input_to_acc" autocomplete="off" spellcheck="false">
|
<input type="text" name="to_acc" class="input_to_acc" maxlength="3" autocomplete="off" spellcheck="false">
|
||||||
{{ form.to_acc }}
|
{{ form.to_acc }}
|
||||||
</td>
|
</td>
|
||||||
<td class="to_acc_data"></td>
|
<td class="to_acc_data"></td>
|
||||||
|
@ -71,18 +71,21 @@ $(document).ready(function () {
|
||||||
var $next = $form.next('.transfer_form').find('.from_acc input');
|
var $next = $form.next('.transfer_form').find('.from_acc input');
|
||||||
}
|
}
|
||||||
var $input_id = $input.next('input');
|
var $input_id = $input.next('input');
|
||||||
|
if (isValidTrigramme(trigramme)) {
|
||||||
getAccountData(trigramme, function(data) {
|
getAccountData(trigramme, function(data) {
|
||||||
$input_id.val(data.id);
|
$input_id.val(data.id);
|
||||||
$data.text(data.name);
|
$data.text(data.name);
|
||||||
$next.focus();
|
$next.focus();
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
$input_id.val('');
|
||||||
|
$data.text('');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.input_from_acc, .input_to_acc').on('input', function() {
|
$('.input_from_acc, .input_to_acc').on('input', function() {
|
||||||
var tri = $(this).val().toUpperCase();
|
var tri = $(this).val().toUpperCase();
|
||||||
if (isValidTrigramme(tri)) {
|
|
||||||
updateAccountData(tri, $(this));
|
updateAccountData(tri, $(this));
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#transfers_form').on('submit', function(e) {
|
$('#transfers_form').on('submit', function(e) {
|
||||||
|
|
Loading…
Reference in a new issue