Don't submit dates form if form is not completed

This commit is contained in:
Olivier PEREZ 2015-05-31 15:45:26 +02:00
parent 44928b0572
commit 94f80687f3

View File

@ -42,11 +42,21 @@ $(document).ready(function () {
if (nb_filled_days >= 1 && nb_filled_hours >= 1) { if (nb_filled_days >= 1 && nb_filled_hours >= 1) {
$('button[name="choixheures"]').removeClass('disabled'); $('button[name="choixheures"]').removeClass('disabled');
return true;
} else { } else {
$('button[name="choixheures"]').addClass('disabled'); $('button[name="choixheures"]').addClass('disabled');
return false;
} }
}; };
// Handle form submission
$(document.formulaire).on('submit', function (e) {
if (!submitDaysAvalaible()) {
e.preventDefault();
e.stopPropagation();
}
});
// Button "Remove all hours" // Button "Remove all hours"
$(document).on('click', '#resethours', function () { $(document).on('click', '#resethours', function () {