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(){
|
||||
// ajaxformulaire();
|
||||
addclass();
|
||||
mapsalles();
|
||||
clickbutton();
|
||||
clicksenddevis();
|
||||
links();
|
||||
slide();
|
||||
filteritem();
|
||||
|
@ -977,3 +977,7 @@
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.ok{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
@ -1,22 +1,8 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% 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>
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function(){
|
||||
|
||||
var form = $('#ajax-test-form');
|
||||
form.submit(function(e) {
|
||||
@ -35,8 +21,20 @@ $(document).ready(function(){
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</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 %}
|
||||
|
@ -24,7 +24,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% 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/leaflet.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 status_mapping = {'success':'green', 'error': 'red', 'warning': 'yellow'} %}
|
||||
{% 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();
|
||||
location.reload();
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user