On hook le popup à form.submit()

This commit is contained in:
Ludovic Stephan 2019-09-26 20:30:04 +02:00
parent 6406b493a2
commit 966cf6ce15

View file

@ -131,6 +131,7 @@ var django = {
{% if not charte %}
<script>
(function ($) {
var charte_ok = false ;
function link_charte() {
$.confirm({
title: 'Charte du BdA',
@ -149,14 +150,17 @@ var django = {
confirmButton: '<span class="glyphicon glyphicon-ok"></span>',
cancelButton: '<span class="glyphicon glyphicon-remove"></span>',
confirm: function() {
charte_ok = true ;
$("#bda_form").submit();
},
});
}
$(document).ready(function($) {
$("#bda-inscr").click(function(e) {
e.preventDefault();
link_charte();
$("#bda_form").submit(function(e) {
if (!charte_ok) {
e.preventDefault();
link_charte();
}
})
})
})(django.jQuery);