|
@@ -1,6 +1,28 @@
|
|
|
{% extends 'partials/base.html.twig' %}
|
|
|
|
|
|
{% block content %}
|
|
|
+<script>
|
|
|
+ $(document).ready(function(){
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+</script>
|
|
|
|
|
|
<div class="header-wrapper">
|
|
|
{% if header.entete.text == true %}
|
|
@@ -15,28 +37,4 @@
|
|
|
{% include "forms/form.html.twig" %}
|
|
|
<div id="form-result"></div>
|
|
|
|
|
|
-<script>
|
|
|
-$(document).ready(function(){
|
|
|
-
|
|
|
- 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);
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
-});
|
|
|
-</script>
|
|
|
-
|
|
|
-
|
|
|
{% endblock %}
|