Skip to content

Instantly share code, notes, and snippets.

@mstaples
Last active December 25, 2015 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mstaples/6945376 to your computer and use it in GitHub Desktop.
Save mstaples/6945376 to your computer and use it in GitHub Desktop.
<script>
function {{ form_name }}Submit() {
$.post( '{{ path( form_path ) }}',
$('#form_{{ form_name }}').serialize(),
function(data){
$('#container_{{ form_name }}').empty().append(data);
}
);
return false;
}
</script>
<div id="container_{{ form_name }}">
<form id='form_{{ form_name }}' method="post" {{ form_enctype(form) }} name="{{ form_name }}" >
{{ form_widget(form) }}
<input type="button" onclick="{{ form_name }}Submit()" />
</form>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment