ajax
This commit is contained in:
parent
6872b491c2
commit
b3800e5e04
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -168,11 +168,38 @@ function burger() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ajaxformulaire() {
|
||||||
|
$(".ok").on('click', function () {
|
||||||
|
$(this).parent('#send-valide').remove();
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
|
||||||
|
var form = $('#ajax-test-form');
|
||||||
|
form.submit(function(e) {
|
||||||
|
// prevent form submission
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
// submit the form via Ajax
|
||||||
|
$.ajax({
|
||||||
|
url: form.attr('action'),
|
||||||
|
type: form.attr('method'),
|
||||||
|
dataType: 'html',
|
||||||
|
data: form.serialize(),
|
||||||
|
success: function(result) {
|
||||||
|
// Inject the result in the HTML
|
||||||
|
$('#form-result').html(result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
jQuery(document).ready(function(){
|
jQuery(document).ready(function(){
|
||||||
|
// ajaxformulaire();
|
||||||
addclass();
|
addclass();
|
||||||
mapsalles();
|
mapsalles();
|
||||||
clickbutton();
|
clickbutton();
|
||||||
|
clicksenddevis();
|
||||||
links();
|
links();
|
||||||
slide();
|
slide();
|
||||||
filteritem();
|
filteritem();
|
||||||
|
@ -977,3 +977,7 @@
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ok{
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
@ -1,20 +1,6 @@
|
|||||||
{% extends 'partials/base.html.twig' %}
|
{% extends 'partials/base.html.twig' %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="header-wrapper">
|
|
||||||
{% if header.entete.text == true %}
|
|
||||||
<div class="entete">
|
|
||||||
<div class="entete_c">
|
|
||||||
<p>{{ header.entete.text }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% include "forms/form.html.twig" %}
|
|
||||||
<div id="form-result"></div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
@ -38,5 +24,17 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div class="header-wrapper">
|
||||||
|
{% if header.entete.text == true %}
|
||||||
|
<div class="entete">
|
||||||
|
<div class="entete_c">
|
||||||
|
<p>{{ header.entete.text }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% include "forms/form.html.twig" %}
|
||||||
|
<div id="form-result"></div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block javascripts %}
|
{% block javascripts %}
|
||||||
|
{% do assets.addJs('jquery', 101) %}
|
||||||
{% do assets.addJs('theme://js/jquery-3.4.1.min.js', {group:'bottom'}) %}
|
{% do assets.addJs('theme://js/jquery-3.4.1.min.js', {group:'bottom'}) %}
|
||||||
{% do assets.addJs('theme://js/leaflet.js', {group:'bottom'}) %}
|
{% do assets.addJs('theme://js/leaflet.js', {group:'bottom'}) %}
|
||||||
{% do assets.addJs('theme://js/imagesloaded.pkgd.min.js', {group:'bottom'}) %}
|
{% do assets.addJs('theme://js/imagesloaded.pkgd.min.js', {group:'bottom'}) %}
|
||||||
|
@ -2,14 +2,16 @@
|
|||||||
{% set inline_errors = form.inline_errors is not null ? form.inline_errors : config.plugins.form.inline_errors(false) %}
|
{% set inline_errors = form.inline_errors is not null ? form.inline_errors : config.plugins.form.inline_errors(false) %}
|
||||||
{% set status_mapping = {'success':'green', 'error': 'red', 'warning': 'yellow'} %}
|
{% set status_mapping = {'success':'green', 'error': 'red', 'warning': 'yellow'} %}
|
||||||
{% set message = inline_errors and form.messages ? "FORM.VALIDATION_FAIL"|t : form.message %}
|
{% set message = inline_errors and form.messages ? "FORM.VALIDATION_FAIL"|t : form.message %}
|
||||||
<script type="text/javascript">
|
|
||||||
var $ok = $('.ok');
|
|
||||||
var $send = $('#send-valide');
|
|
||||||
|
|
||||||
$ok.on('click', function () {
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
$(".ok").on('click', function () {
|
||||||
$(this).parent('#send-valide').remove();
|
$(this).parent('#send-valide').remove();
|
||||||
location.reload();
|
location.reload();
|
||||||
})
|
});
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user