Classic poll: Don't submit choices form if form is not completed
This commit is contained in:
parent
e8a1f37c98
commit
474c595b88
@ -28,11 +28,21 @@
|
|||||||
});
|
});
|
||||||
if (nb_filled_choices >= 1) {
|
if (nb_filled_choices >= 1) {
|
||||||
$('button[name="fin_sondage_autre"]').removeClass('disabled');
|
$('button[name="fin_sondage_autre"]').removeClass('disabled');
|
||||||
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$('button[name="fin_sondage_autre"]').addClass('disabled');
|
$('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"
|
// Button "Add a choice"
|
||||||
|
|
||||||
$('#add-a-choice').on('click', function () {
|
$('#add-a-choice').on('click', function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user