Add hidden fields to a great form creating plugin!
I love the Contact Form 7 plugin, and use it for many of my projects…but one thing it’s missing is the ability to add hidden fields.
Now that Contact Form 7 2.0 has been released, it’s easy to add new types of inputs. Add hidden tag functionality and “Generate Tag” capability by downloading the file below and replacing/adding the three files included.
Updates:
- August 5, 2009 – Now updated for 2.0.1
- August 11, 2009 – Fixed bug with 2.0.1 Version. Thanks, @Courtney
Did this make your life easier? Was this information worth a buck?
Donate with PayPal (Much appreciated!)
Related posts:
- Constant Contact WordPress Widget – Add a Newsletter Signup Form to your Sidebar
- {{SEO WordSpinner Plugin – A Killer SEO Plugin for WordPress|Kick SEO Ass with SEO WordSpinner Plugin for WordPress|WordPress Content Spinner Plugin – SEO WordSpinner}}
- WordPress Comment Form 404 Error – Now Fixed!
- How to tell if your WordPress Plugin or Widget is Activated in WordPress
- Improve Gravity Forms – Gravity Forms Addons Plugin
Katz Web Services is a
{ 29 comments… read them below or add one }
I posted this question on the WP support forum as well, but thought I might get a faster answer here, so here it is again:
I need to send an email to a sendmail bot with the following PHP mail function:
mail(to,subject,message,headers,parameters)
I can get it to do everything except add the last parameter (it needs to be -f –using the Contact Form 7 code to extract the email address).
Will this plug in do this for me?
Thanks.
I would post that question on the website of the plugin itself, not only the WordPress.org support page.
i tried to put a template tag “” inside y hidden field but dosent work, anywone can help me please.
Please put the code inside <code> and </code> tags, so that it shows up in your comment.
Hi Zack,
How can we include the %post_title% from which the contact form was embedded ? Possibly the post title could be the default value of a text field which is then sent in the “additional headers” section…
Regards,
Len
I believe that would need to be a different module. You could just modify this, if you wanted to… I don’t have the time right now.
Great work. Seems like it will work with only 2.0 (and not 2.0.1, which is the current version). Let me try to get my hands dirty and see if I can help.
I’ve updated the module for 2.0.1 — here’s a download link.
The link its not work
Invalid File ID or File Name.
When I move over the files, I get this error:
Fatal error: Call to undefined function wpcf7_admin_url() in /home/content/i/n/t/intweb/html/getintouch/wp-content/plugins/contact-form-7/admin/admin-panel.php on line 40
So, I looked at the original admin.php file and it has a function called “wpcf7_admin_url” which is missing from your new one, which overwrote it. When I added function into your admin.php, the error went away.
Thanks for the heads up, I will look into it.
Just to check, did you download the correct version? There are two versions: 2.0 and 2.0.1.
I’m not sure how that happened, but I’ve fixed this in the downloadable version. Thanks for your help!
Thanks a ton! I was trying to reverse engineer the “text” handler, but somehow that didn’t seem to work. I’ve installed the updated version, but the admin panel for CF 7 doesn’t load and the module doesn’t seem to work. I guess my PHP error messages are disabled, as I don’t get to see any error messages.
Update: Deleted the admin files, left the module file in place. Hidden fields are now parsed in generated forms. But when the forms are submitted, the placeholders [place-holder] are not replaced.
Thanks Courtney, I had the same error.
The function was left out of the Misc. section of the 2.0.1 update file.
Seems to be fine now.
Thanks for a great plugin
Update 2: I uploaded the file “hidden.php” to the modules directory, and manually copied the changes to “admin.php” and “wpcf7-admin.js” in the admin folder. All works well now.
How can I add value to hidden field in this plugin?
Can somebody give example of use?
Thanks
Thanks for the great update to this plugin. I’m a little surprised it doesn’t natively come with hidden fields options. Hidden fields are an excellent way to get info from form submissions.
I need the value of the hidden field to be set from the query string.
Any ideas how to do this?
Thanks a lot!
By the way it’s an update, to this great plugin, very helpful for many.
Tahnks again.
The Gravity Forms plugin has this functionality built in, as does cForms.
Also looking for a solution to send query string.
I recommend using the Gravity Forms plugin.
This doesn’t work with WP 2.8.5 and CF7 2.0.6 . Error I get in Admin is:
Fatal error: Cannot redeclare wpcf7_admin_url() in /home/xxx/public_html/wp-content/plugins/contact-form-7/admin/admin.php on line 324
I really need hidden fields to work with this plugin
Thanks for all your help!
I will be updating this to work with 2.0.6 eventually, but not in the next couple of weeks. Sorry!
@Zack How about in the next couple of months? Is the download link available?
Hi Craig,
I didn’t know the downloads had disappeared. They’re back up now.
I am no longer going to support this modification, because the plugin author continues to not add this simple functionality, and the modules functionality requires modifying the plugin core files.
How can I make the input fields smaller in width?
I heard there’s a written addition to CF7 which allows you to store query string parameters. Anyone?