Rendere il bic obbligatorio solo se nazione non è Italia

This commit is contained in:
Emanuele "ToX" Toscano 2023-03-21 18:32:51 +01:00
parent c91406196f
commit 97985a5212
2 changed files with 14 additions and 0 deletions

View File

@ -76,6 +76,7 @@ echo '
var branch_code = input("branch_code");
var bank_code = input("bank_code");
var id_nazione = input("id_nazione");
var bic = input("bic");
var components = [branch_code, bank_code, id_nazione];
@ -117,6 +118,12 @@ echo '
dataType: "json",
success: function (response) {
compilaCampi(response);
if (response.id_nazione.text === "Italia"){
bic.setRequired(false);
} else {
bic.setRequired(true);
}
},
error: function() {
toastr["error"]("<?php echo tr('Formato IBAN non valido'); ?>");

View File

@ -149,6 +149,7 @@ if (!empty($numero_documenti)) {
var check_digits = input("check_digits");
var national_check_digits = input("national_check_digits");
var id_nazione = input("id_nazione");
var bic = input("bic");
var components = [branch_code, bank_code, account_number, check_digits, national_check_digits, id_nazione];
@ -190,6 +191,12 @@ if (!empty($numero_documenti)) {
dataType: "json",
success: function (response) {
compilaCampi(response);
if (response.id_nazione.text === "Italia"){
bic.setRequired(false);
} else {
bic.setRequired(true);
}
},
error: function() {
toastr["error"]("<?php echo tr('Formato IBAN non valido'); ?>");