title: Javascript issue re form reset
body: <p>I've got an issue with a small javascript form that submits perfectly, brings up the success message but fails to reset the form. The data remains visible, until you manually refresh the page.</p>
  
  <p>The code is:</p>
  
  <pre><code>jQuery(document).ready(function(){
  
      $('#contactform').submit(function(){
  
          var action = $(this).attr('action');
  
          $("#message").slideUp(750,function() {
          $('#message').hide();
  
          $('#submit')
              .after('&lt;img src="images/ajax-loader.gif" class="loader" /&gt;')
              .attr('disabled','disabled');
  
          $.post(action, {
              name: $('#name').val(),
              email: $('#email').val(),
              phone: $('#phone').val(),
              subject: $('#subject').val(),
              comments: $('#comments').val(),
              verify: $('#verify').val()
          },
              function(data){
                  document.getElementById('message').innerHTML = data;
                  $('#message').slideDown('slow');
                  $('#contactform img.loader').fadeOut('slow',function(){$(this).remove()});
                  $('#submit').removeAttr('disabled');
                  if(data.match('success') != null);
  
              }
          );
  
          });
  
          return false;
  
      });
  
  });
  </code></pre>
  
  <p>I wondered if I can add in a reset command but as my java is limited I'm not sure where? Would appreciate any pointers or advice. Thanks in advance.</p>