Bugfix: dopo un primo errore, il form delle rate non si salvava più

This commit is contained in:
Fabio Lovato 2018-07-23 11:15:38 +02:00
parent 9f390c3702
commit 034bd44865
1 changed files with 9 additions and 2 deletions

View File

@ -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();
}
});
});