From 38c5cc2ab8465ab99fd5e3b1b57e77ce866363aa Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Fri, 5 Aug 2022 17:18:04 +0200 Subject: [PATCH] Fix aggiunta modelli di prima nota --- modules/modelli_primanota/edit.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/modelli_primanota/edit.php b/modules/modelli_primanota/edit.php index aa03a86d7..ad3da3fda 100755 --- a/modules/modelli_primanota/edit.php +++ b/modules/modelli_primanota/edit.php @@ -136,15 +136,18 @@ echo ' }); $(document).on("change", "select", function() { - let row = $(this).parent().parent(); + let row = $(this).parent().parent().parent(); if (row.find("input[disabled]").length > 1) { row.find("input").prop("disabled", !$(this).val()); } + + // Trigger dell\'evento keyup() per la prima volta, per eseguire i dovuti controlli nel caso siano predisposte delle righe in prima nota + $("input[id*=dare][value!=\'\'], input[id*=avere][value!=\'\']").keyup(); }); $(document).on("keyup change", "input[id*=dare]", function() { - let row = $(this).parent().parent(); + let row = $(this).parent().parent().parent(); if (!$(this).prop("disabled")) { row.find("input[id*=avere]").prop("disabled", $(this).val().toEnglish()); @@ -152,7 +155,7 @@ echo ' }); $(document).on("keyup change", "input[id*=avere]", function() { - let row = $(this).parent().parent(); + let row = $(this).parent().parent().parent(); if (!$(this).prop("disabled")) { row.find("input[id*=dare]").prop("disabled", $(this).val().toEnglish());