title: jQuery reset form after post?
body: <p>I have a form; I am using jQuery to post this form, but now I wonder how I can "reset" the form when I posted done? </p>
  
  <p>My jQuery and PHP code:</p>
  
  <pre><code>&lt;?php
  chdir('../');
      include("_mysql.php");
      include("_settings.php");
      include("_functions.php");
  chdir('admin');
  
  if (isset($_POST['rubric'])) { 
      if (empty($_POST['rubric']) &amp;&amp; empty($_POST['content'])) { 
          echo '&lt;div class="alert alert-error alert-box"&gt;Du måste fylla i alla fält.&lt;/div&gt;'; 
      }
      else { 
          $rubric = $_POST['rubric'];
          $sql = "INSERT INTO ".PREFIX."news(`date`, `poster`)
          VALUES('".time()."', '".$userID."')"; 
          mysql_query($sql);
          $id = mysql_insert_id();
          $sql2 = "INSERT INTO ".PREFIX."news_contents(`newsID`,  `headline`, `content`)
          VALUES('".$id."', '".$rubric."', '".$_POST['content']."')";
          mysql_query($sql2);
          echo '&lt;div class="alert alert-box alert-success"&gt;Klart, nyheten postad.&lt;/div&gt;'; 
      }
  }
  ?&gt;
  
      $("#form").submit(function(event) {
      event.preventDefault();
      var poster = $.post('addnews.php', $(this).serialize());
      poster.done(function(data) {
          $(".result").html(data);
      });
  });
  </code></pre>
  
  <p>Does anyone know how I can do this? Because now when I post a new the rubric and content is still there, and I dont really know how to unset the variables. </p>
  
  <p>And I really still want my error, and accept message left if possible. </p>