Classic poll: Don't submit choices form if form is not completed

This commit is contained in:
Olivier PEREZ 2015-05-31 16:02:21 +02:00
parent e8a1f37c98
commit 474c595b88

View File

@ -28,11 +28,21 @@
});
if (nb_filled_choices >= 1) {
$('button[name="fin_sondage_autre"]').removeClass('disabled');
return true;
} else {
$('button[name="fin_sondage_autre"]').addClass('disabled');
return false;
}
};
// Handle form submission
$(document.formulaire).on('submit', function (e) {
if (!submitChoicesAvalaible()) {
e.preventDefault();
e.stopPropagation();
}
});
// Button "Add a choice"
$('#add-a-choice').on('click', function () {