Title: Form Fields do not reset
Last modified: August 21, 2016

---

# Form Fields do not reset

 *  Resolved [isfak](https://wordpress.org/support/users/isfak/)
 * (@isfak)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/form-fields-do-not-reset/)
 * Hello,
 * It seems that this plugin prevents the contact form 7 fields from being reset
   when you refresh (F5) the browser page.
    How can we reset the form upon loading?(
   without a reset button I mean).
 * I already tried putting a document.getElementById(“form_id”).refresh() inside
   a window.onload() javascript function in the beggining of the form but it doesn’t
   work.
 * Any ideas?
    Thank you in advance
 * [https://wordpress.org/plugins/contact-form-7-multi-step-module/](https://wordpress.org/plugins/contact-form-7-multi-step-module/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [webheadcoder](https://wordpress.org/support/users/webheadllc/)
 * (@webheadllc)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/form-fields-do-not-reset/#post-5138173)
 * This is actually a feature for when the Back button is used. The form is populated
   from the cookie that is stored on your browser. The only ways to not get it to
   populate is to submit and complete all steps in your form or delete the cookie.
   I think the cookie may expire once you close your browser too.
 *  Thread Starter [isfak](https://wordpress.org/support/users/isfak/)
 * (@isfak)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/form-fields-do-not-reset/#post-5138175)
 * Thanks for the quick reply.
 * The problem is that I have another page on the website that passes some field
   values as parameters to the page containing the form. These field values are 
   ignored by the form since the cookie sets its own values.
 * Of course, I don’t want to make the user delete the cookies from their browsers
   or close browser and reopen for this to work. Isn’t there a way to tell the form
   to delete the cookie upon load? Or set the values contained in the cookie to 
   null or something?
 * Thanks again!
 *  Plugin Author [webheadcoder](https://wordpress.org/support/users/webheadllc/)
 * (@webheadllc)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/form-fields-do-not-reset/#post-5138234)
 * Not quite sure what you need, but on the first page you can try adding some javascript
   to clear the cookie named “cf7msm_posted_data”.
 *  Thread Starter [isfak](https://wordpress.org/support/users/isfak/)
 * (@isfak)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/form-fields-do-not-reset/#post-5138237)
 * Thanks. So I tried several times to delete the cookie by the following code (
   found in [http://stackoverflow.com/questions/10593013/delete-cookie-by-name](http://stackoverflow.com/questions/10593013/delete-cookie-by-name)):
 *     ```
       <script type="text/javascript">
       document.cookie = 'cf7msm_posted_data=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
       </script>
       ```
   
 * What I get when hitting ‘Save’ at the contact form is an error: ‘Forbidden – 
   You don’t have permission to access /wp-admin/admin.php on this server.’
    and
   it just doesn’t save.
 * Any ideas?
    Thanks again
 *  Plugin Author [webheadcoder](https://wordpress.org/support/users/webheadllc/)
 * (@webheadllc)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/form-fields-do-not-reset/#post-5138256)
 * sorry, i don’t know why you’d be getting that forbidden message.
 *  Thread Starter [isfak](https://wordpress.org/support/users/isfak/)
 * (@isfak)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/form-fields-do-not-reset/#post-5138261)
 * Ok, it worked like that: I added the following code to functions.php file of 
   the theme I use (this sets the cookie named cf7msm_posted_data to past time, 
   so it actually gets deleted, and the form is reset):
 *     ```
       add_action('init', function() {
           if (isset($_COOKIE['cf7msm_posted_data'])) {
               setcookie('cf7msm_posted_data', null, strtotime('-1 day'));
           }
       });
       ```
   
 * Found it here: [http://stackoverflow.com/questions/6183162/how-can-i-set-get-and-destroy-cookies-in-wordpress](http://stackoverflow.com/questions/6183162/how-can-i-set-get-and-destroy-cookies-in-wordpress)
 * Thanks for the support!
 *  [amruta1](https://wordpress.org/support/users/amruta1/)
 * (@amruta1)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/form-fields-do-not-reset/#post-5138335)
 * hi ,
    I am also having the same problem. I have added the above code in theme’s
   function.php file still it doesn’t work for me. Please help.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Form Fields do not reset’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7-multi-step-module/assets/icon-256x256.png?
   rev=1793363)
 * [Contact Form 7 Multi-Step Forms](https://wordpress.org/plugins/contact-form-7-multi-step-module/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-multi-step-module/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-multi-step-module/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-multi-step-module/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-multi-step-module/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-multi-step-module/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [amruta1](https://wordpress.org/support/users/amruta1/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/form-fields-do-not-reset/#post-5138335)
 * Status: resolved