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