From 9960e7e37eccc216d983d15fbd75097d9dbbe0b2 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Thu, 17 Nov 2016 16:51:36 -0200 Subject: [PATCH] rebase kfet --- kfet/templates/kfet/transfers_create.html | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/kfet/templates/kfet/transfers_create.html b/kfet/templates/kfet/transfers_create.html index 294db1e5..83a09762 100644 --- a/kfet/templates/kfet/transfers_create.html +++ b/kfet/templates/kfet/transfers_create.html @@ -34,12 +34,12 @@ - + {{ form.from_acc }} {{ form.amount }} - + {{ form.to_acc }} @@ -71,18 +71,21 @@ $(document).ready(function () { var $next = $form.next('.transfer_form').find('.from_acc input'); } var $input_id = $input.next('input'); - getAccountData(trigramme, function(data) { - $input_id.val(data.id); - $data.text(data.name); - $next.focus(); - }); + if (isValidTrigramme(trigramme)) { + getAccountData(trigramme, function(data) { + $input_id.val(data.id); + $data.text(data.name); + $next.focus(); + }); + } else { + $input_id.val(''); + $data.text(''); + } } $('.input_from_acc, .input_to_acc').on('input', function() { var tri = $(this).val().toUpperCase(); - if (isValidTrigramme(tri)) { - updateAccountData(tri, $(this)); - } + updateAccountData(tri, $(this)); }); $('#transfers_form').on('submit', function(e) {