From 034bd44865b7a70a20a146c6d65916c571bf86cb Mon Sep 17 00:00:00 2001 From: Fabio Lovato Date: Mon, 23 Jul 2018 11:15:38 +0200 Subject: [PATCH] =?UTF-8?q?Bugfix:=20dopo=20un=20primo=20errore,=20il=20fo?= =?UTF-8?q?rm=20delle=20rate=20non=20si=20salvava=20pi=C3=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/pagamenti/edit.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/pagamenti/edit.php b/modules/pagamenti/edit.php index 102e55f72..28615d208 100644 --- a/modules/pagamenti/edit.php +++ b/modules/pagamenti/edit.php @@ -179,8 +179,12 @@ $(document).ready(function(){ $(this).parentsUntil('.box').find('[id*=giorno]').prop('disabled', false); } }); + + $(document).on('change', '[id*=percentuale]', function(){ + $('button[type=submit]').prop( 'disabled', false ).removeClass('disabled'); + }); - $('#edit-form').submit(function(event) { + $('#edit-form').submit( function(event) { var tot = 0; $(this).find('[id*=percentuale]').each(function(){ @@ -190,9 +194,12 @@ $(document).ready(function(){ tot += prc; }); - if(tot != 100) { + if( tot != 100) { $('#wait').removeClass("hide"); event.preventDefault(); + } else { + $('#wait').addClass("hide"); + $(this).unbind('submit').submit(); } }); });