I try builtin way without success, only Ajax worked for me. Here’s what I do:
...
{# Include the form in page template where all the page should have the same form #}
{% set formdata = page.find('/form').header.form %}
{% include "forms/form.html.twig" with {'form': formdata} %}
...
...
...
{% block javascript %}
...
<script>
// submit the form via Ajax
$(document).ready(function(){
$('#oneform').submit(function(e) {
e.preventDefault();
$.ajax({
url: '{{ page.find('/form').url }}',
type: form.attr('method'),
dataType: 'html',
data: form.serialize(),
success: function(result) {
$('#form-result').html(result);
}
});
});
});
</script>
...
{% endblock %}
---