From 9302bf364bb89a0e864b74b8c0983d75d7110279 Mon Sep 17 00:00:00 2001 From: Pek5892 Date: Fri, 23 Jun 2023 14:54:33 +0200 Subject: [PATCH] Fix #1066 --- modules/banche/add.php | 51 ++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/modules/banche/add.php b/modules/banche/add.php index b613f7346..68f73414f 100755 --- a/modules/banche/add.php +++ b/modules/banche/add.php @@ -107,32 +107,35 @@ echo ' } function scomponiIban() { - $.ajax({ - url: globals.rootdir + '/actions.php', - data: { - id_module: globals.id_module, - op: "decompose", - iban: iban.get(), - }, - type: 'GET', - dataType: "json", - success: function (response) { - compilaCampi(response); + let value = iban.get(); + if (value.length > 25) { + $.ajax({ + url: globals.rootdir + '/actions.php', + data: { + id_module: globals.id_module, + op: "decompose", + iban: iban.get(), + }, + type: 'GET', + dataType: "json", + success: function (response) { + compilaCampi(response); - if (response.id_nazione.iso2 === "IT"){ - bic.setRequired(false); - var label_text = $('label[for=bic] span .text-red').text(); - $('label[for=bic] span .text-red').text(label_text.replace('*', ' ')); - } else { - bic.setRequired(true); - var label_text = $('label[for=bic] span .text-red').text(); - $('label[for=bic] span .text-red').text(label_text.replace(' ', '*')); + if (response.id_nazione.iso2 === "IT"){ + bic.setRequired(false); + var label_text = $('label[for=bic] span .text-red').text(); + $('label[for=bic] span .text-red').text(label_text.replace('*', ' ')); + } else { + bic.setRequired(true); + var label_text = $('label[for=bic] span .text-red').text(); + $('label[for=bic] span .text-red').text(label_text.replace(' ', '*')); + } + }, + error: function() { + toastr["error"](""); } - }, - error: function() { - toastr["error"](""); - } - }); + }); + } } function componiIban() {