Contact Form 7: Clear all field except specific after submission

advertisement

wordpressJust had a job in WordPress and Contact Form 7. My client required some fields to have default value for all the time. However, whenever user submit the form, CF7 will clear all the field once the submission is successful. After some research, i manage to find a solution to retain the field value for CF7 after submission.

Contact Form 7 to clear all field except specific one after submission, follow the steps below:-

  • To clear all field value except the one that you need, you have to overwrite the clearForm function.
  • Just edit the footer.php and add in these code before the body tag and your will be able to retain your field value after successful submission with CF7.

    *** replace #your-selector with your selector
  • Now you may try to do a form submission and your selector value should be retain even the form submission is successful.

Happy Blogging!

Related posts:

Namecheap Coupon 2007 - April
Download Mozilla Thunderbird 3 Email Client
How to add HTML Signature in Thunderbird
How to upload file in Symfony 1.4
How to create Table of Contents in LibreOffice
Common MySQL database maintenance command
SVN: How to commit only modified files via command line
Cynogenmod: No Vibration when Receiving SMS






One Response to “Contact Form 7: Clear all field except specific after submission”

  1. Andriy says:

    this is what i’m facing.
    whenever successful submission it will clear all the field
    now this solution can let me retain my value!

Leave a Reply