title: Form submission using backbone
body: <p>I am using <strong>Backbone</strong> to submit a form. The form resides in html page (home page). I used <strong>.save()</strong> method of backbone model to save data in database when the form submitted. I used <strong>e.preventDefault();</strong> to prevent submission and catch the values. </p>
  
  <p>The problem is after submission the form remain unchanged that means input fields filled up with previous values.If I again submit the form then previous values insert in database.</p>
  
  <p>How is it possible to make the form as like first state(blank) after submission ??</p>
  
  <p><strong>Codes</strong></p>
  
  <p><strong>HTML</strong> </p>
  
  <pre><code>&lt;form  method="post" id="my_form"&gt;                    
       &lt;input type="text" id="name" size="30"  required autofocus/&gt;
       &lt;input type="email" id="email " size="30" required/&gt;
       &lt;input type=" text " id="catagory" size="30" required/&gt;                        
       &lt;input type="submit"  value="Submit"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>backbone</strong></p>
  
  <pre><code>var My_view = Backbone.View.extend(
  {
      el: $("body"),
      events: 
      {
          "submit #my_form": "save"    
      }, 
      initialize: function()
      {
          _.bindAll(this,'save');
      },
      save: function(e)
      {  
          e.preventDefault();
          var name = $('#name').val();
          var email = $('#email').val();  
          var catagory = $('#catagory').val(); 
  
          var data = {
              name : name, 
              email : email, 
              catagory : catagory 
          };
  
          var my_model = new My_model();              
  
          my_model.save(data, 
          {
              success: function(model,response) 
              {
                  alert(JSON.stringify(response));
              },
              error: function(model,response)
              {
                  alert(JSON.stringify(response));     
              }
          }); 
      }
  });
  
  
  var my_view = new My_view({});
  </code></pre>