diff --git a/js/app/date_poll.js b/js/app/date_poll.js index 67c71a0..d63684d 100644 --- a/js/app/date_poll.js +++ b/js/app/date_poll.js @@ -42,11 +42,21 @@ $(document).ready(function () { if (nb_filled_days >= 1 && nb_filled_hours >= 1) { $('button[name="choixheures"]').removeClass('disabled'); + return true; } else { $('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" $(document).on('click', '#resethours', function () {