title: Clearing the form fields after submit in wordpress
body: <p>How to clear the for, fields once the data is submitted.After clicking on submit the data in the text box is not getting cleared.</p>
  
  <p>HTML:</p>
  
  <pre><code>function html_form_code() {
  echo '&lt;div class="thb_subscribe"&gt;';
  echo '&lt;h3 class="subscriberlogin"&gt;SUBSCRIBE&lt;/h3&gt;';
  echo '&lt;p class="subscribertext"&gt;Subscribe now to get notified about latest updates!!&lt;/p&gt;';
  echo '&lt;form action="' . esc_url( $_SERVER['REQUEST_URI'] ) . '" method="post"&gt;';
  
  echo '&lt;div class="emails" style="margin-left: -308px;"&gt;';
  echo '&lt;input type="email" id="cf-email" name="cf-email" placeholder="Your E-Mail" value="' . ( isset( $_POST["cf-email"] ) ? esc_attr( $_POST["cf-email"] ) : '' ) . '" size="42" required /&gt;';
  echo '&lt;/div&gt;';
  
  echo '&lt;div class="subjectline" style="display:none;"&gt;';
  echo 'Subject (required) &lt;br/&gt;';
  echo '&lt;input type="text" name="cf-subject" pattern="[a-zA-Z ]+" value=" Subscription List"  /&gt;';
  echo '&lt;/div&gt;';
  
  echo '&lt;div class="signup"&gt;&lt;input type="submit" name="cf-submitted" value="Sign Up"&gt;&lt;/div&gt;';
  echo '&lt;/form&gt;';
  echo '&lt;/div&gt;';
   }
  </code></pre>
  
  <p>Script:</p>
  
  <pre><code>jQuery(document).ready(function($) {
  $('#cf-email').val(''); //txtID is textbox ID
  });​
  </code></pre>
  
  <p>Tried with this code but it is not working.</p>
  
  <p>Sending Email:</p>
  
  <pre><code>function deliver_mail() {
  
  // if the submit button is clicked, send the email
  if ( isset( $_POST['cf-submitted'] ) ) {
  
      // sanitize form values
      $email   = sanitize_email( $_POST["cf-email"] );
      $subject = sanitize_text_field( $_POST["cf-subject"] );
      $message = "This person $email  has been subscribed to your channel. ";
  
      // get the blog administrator's email address       
      $to = 'XXXX@gmail.com';
  
      $headers = "From:  &lt;$email&gt;" . "\r\n";
  
      // If email has been process for sending, display a success message
      if ( wp_mail( $to, $subject, $message, $headers ) ) {
          echo '&lt;div&gt;';
          echo '&lt;div id="deletesuccess"&gt;Thanks for Subscribing .&lt;/div&gt;';
          echo '&lt;/div&gt;';
      } else {
          echo 'An unexpected error occurred';
      }
  }
  }
  </code></pre>