title: how to clear the form fields after submit data through ajax in symfony2?
body: <p><code>my new.html.twig</code> code is given below. How do I clear the form fields after the form submission?</p>
  
  <pre><code>{% extends '::base.html.twig' %}
  
  {% block body -%}
  &lt;h1&gt;Proposals creation&lt;/h1&gt;
  
  &lt;form action="{{ path('proposals_create') }}" method="post" {{ form_enctype(form) }}&gt;
      {{ form_widget(form) }}
      &lt;p&gt;
          &lt;button type="submit"&gt;Create&lt;/button&gt;
      &lt;/p&gt;
  &lt;/form&gt;
  
      &lt;ul class="record_actions"&gt;
  &lt;li&gt;
      &lt;a href="{{ path('proposals') }}"&gt;
          Back to the list
      &lt;/a&gt;
  &lt;/li&gt;
  &lt;/ul&gt;
  &lt;div id="result"&gt;&lt;/div&gt;
  {% endblock %}
  {% block javascripts %}
  &lt;script src="{{ asset('js/jquery-1.10.2.js') }}" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
   $().ready(function() {
       $("form").submit(function(e) {
           e.preventDefault();
           var $url = $(this).attr('action');
           var $data = $(this).serialize();
           $.ajax({
              type: "POST",
              url: $url,
              data: $data
           }).done(function( result ) {
              if(result.success) {
                  $('#result').html('&lt;span&gt;Monetary expense correctly saved!&lt;br/&gt; The data are:&lt;br/&gt;id: '+ result.id +'&lt;br/&gt;descrition: '+ result.description +'&lt;br/&gt;proposalname: '+ result.proposalname +'&lt;br/&gt;status: '+ result.status +'&lt;/span&gt;');
              }
           });
       });
   });
  
   &lt;/script&gt;
  {% endblock %}
  </code></pre>