Don't submit dates form if form is not completed
This commit is contained in:
parent
44928b0572
commit
94f80687f3
@ -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 () {
|
||||||
|
Loading…
Reference in New Issue
Block a user