Porpavek JS pri posiljanju

This commit is contained in:
Robert 2021-12-01 13:59:57 +01:00
parent 16d01a0854
commit 99adf02df9

View File

@ -1122,14 +1122,15 @@
}
);
jQuery('g-recaptcha-response')
if (jQuery('.error-field, .error-color').length > 0 || jQuery('#varnostno-polje').val().length > 0 ) {
return '';
}
//Onemogočimo dvojno pošiljanje
var pocakaj = jQuery(this).attr('data-wait');
var textOddaj = jQuery(this).val();
jQuery(this).attr('data-wait', textOddaj);
jQuery(this).val(pocakaj).attr('disabled', 'disabled');
@ -1142,6 +1143,9 @@
jQuery('#narocilo-poslovni-uporabniki').hide();
jQuery('#nakup-1ka-poslovni-uporabniki .uspesno-oddano-narocilo').show();
jQuery('.vsebina h1').text('Uspešno oddano naročilo');
} else if(val.error) {
jQuery(this).attr('data-wait', pocakaj);
jQuery(this).val(textOddaj).attr('disabled', '');
}
});