Recently, I wanted to add a contact form to our Social Media Blog & Resource Center which is built on WordPress (v 2.8.4, as of this post). I tested out a number of plugins and finally settled on cforms, and I'm very pleased with it. The latest version is cformsII which the developer, Delicious Days, describes as " a powerful and feature rich form plugin for WordPress, offering convenient deployment of multiple Ajax driven contact forms throughout your blog or even on the same page."
I found this plugin to be quite easy to install and configure, and was impressed with all its features, especially the ability to add CAPTCHA or challenge questions to the form. It's very easy to add form fields of all kinds and there are many different styling options which are available with a click.
Because the form submission is handled via Ajax, you don't have to worry about SMTP server settings or anything. It's really pretty much plug 'n' play.
This article will guide you through installation and configuration of cformsII.
Installing cforms
Just download the cforms plugin and, as with most WordPress plugins, unzip it and upload it into your WordPress plugins directory.
Important: Because cforms appears to assume your WordPress installation is in the document root of your website, instead of in a subdirectory, I recommend that before activating the plugin, you FTP into your server to:
wp-content > plugins > cforms > js
and open the file "cforms.js" with your text editor and make sure that, on line 19, the following variable is correct:
var sajax_uri = '/wp-content/plugins/cforms/lib_ajax.php';
The above setting is correct if your blog is at the document root of your website. If your WordPress install is in a subdirectory, you need to modify this variable to:
var sajax_uri = '/name-of-subdirectory/wp-content/plugins/cforms/lib_ajax.php';
After making any modifications, save the file.
You can now activate the plugin via your admin panel, in "Plugins" - and you shouldn't get a warning about the path being incorrect.
Configuring cforms
Once the cformsII plugin is activated, you can now configure it.
In your admin panel you'll see, after the "Settings" link, a "cformsII" link:
Click this link to see the various options for configuring cformsII:
Form Settings
I recommend leaving the "Ajax enabled" checkbox checked.
Give your form a name (I recommend not having spaces in the name, so something like "ContactForm" or whatever). This name will be used when we insert the form into a WordPress page.

To change the Field Name (this name is what will be displayed on your form), just click in the gray box and change what's there to what you want.
To add a field, first select the position where it is to be added in the form, then click on the "** Add **" button.
You can then name the field and select what kind of field it is from the pulldown menu to the right of the Field Name.
As you can see from the above example, I added a CAPTCHA verification field.
To set which fields are required and how they function is a piece of cake:

cformII defaults are pretty much what you'll want here, but you can make any field required. The "e-mail" option is just for fields with email addresses and it verifies that the email address entered conforms to email syntax (name@domain.com or .net etc.).
The "auto-clear" option, if checked, will render the Field Name in the text-entry field and, when the user clicks into that field to enter their name, the Field Name text will disappear.
Under "Admin Email Message Options" you select who receives the email generated by the form submission, and who the form is from.
If you want the "From" to be the user's email address they entered, in the "From: email address" field, enter: {Email}
The "Subject admin email" is the Subject line for the email you'll receive.
I unchecked "Enable HTML" as it made the email I received from the form submission a mess, with a bunch of code that didn't render properly. Your mileage may vary, but I thought, Who needs this?
The many other options in the "Form Settings" screen can pretty much be left alone, unless you want to redirect the user to a "success" or "thanks" page after they submit the form. The default is a success message showing up above the form after it's successfully sent. But you should review the various options to see what they are, as there are many powerful features in cformsII.
Global Settings
There are a number of options here, but the only one I worked with was the "CAPTCHA Image Settings" where you can set colors, how many characters are shown, etc.
Styling
Here you can pick from a number of options for how your form is rendered on your WordPress page.
You can audition the various styles by selecting a style from the pulldown list, then clicking "Select Style" - it will be rendered just to the right. I liked "minimal.css" the best. You can see our implementation on our Social Media Blog & Resource Center contact page.
To tweak the stylesheet for the style you have selected, click on "Styling" in the left cformsII navigation; click the "Basic CSS editor: [stylesheet-you-chose].css" and make edits. (Note: Back up the style sheet, which is located in "plugins > cforms > Styling > [stylesheet-you-chose].css" Click "Update Settings" when you're done. The permissions on the stylesheet must be set to 777 to make changes through the admin panel.
NOTE: On one client's blog, the CAPTCHA image and reset button wrapped below where the user enters the CAPTCHA characters. I had something to do with the theme for this WordPress blog, and I had to add the following CSS style to our theme style sheet (each theme's style sheet is located at: wp-content/themes/name-of-theme/ and is usually called "style.css" - best practices dictate adding modifications to this style sheet after the default styles):
ol.cf-ol li#li--5 { margin:0; padding:0; width:410px !important; }
img.captcha { float:right !important;}
img.captcha-reset { float:right;}
Again, your mileage may vary, but I couldn't see why the CAPTCHA was wrapping. Drove me crazy! The above CSS did, however, fix the display.
Adding the cforms Form to a WordPress Page
Just create your page in WordPress. After whatever other text you want to display on the page, just add this bit:
<!--cforms name="name-of-form"-->
Change "name-of-form" to your form's name.
Once you've done this, test it out to see if it's working properly.



#1 by shoesie - August 27th, 2009 at 04:08
Hi, thanks so much for the guide to setting up a form with cforms. It was extremely useful. I tried setting up database tracking in the global settings but the page shows no data. Have you tried this?
#2 by admin - August 27th, 2009 at 04:44
I haven't tried to set up database track, but I'll try to look into it very soon. You should make sure that whatever directory & file you're writing the form data to has "writeable" permissions: 775 or 777. There are security concerns about this, but it's necessary to set the permissions for the csv file to which you want to write data to be writeable.
#3 by Keith Davis - October 10th, 2009 at 03:20
Just what I needed and just when I needed it.
I'm in the process of setting up a WordPress site and was looking for a forms plugin. Cforms is the one most people recommend but I wasn't impressed with the documentation on the cforms site.
Your tutorial has made all the difference.
#4 by Ryan - October 27th, 2009 at 15:27
Hmm.. for some reason I can't get this crazy form to show up.. I'm gonna keep trying but I've inserted the code snippet into my page post and everything is installed but still no forms appearing on page.. Page content appears, just not forms.. ????
#5 by timware - November 22nd, 2009 at 12:31
Ryan, Did you ever get this sorted out? I had difficulty today getting cformsII to show up on a blog page on which I was installing it. I was using the old syntax:
<!--cforms name="form-name"-->and it wasn't showing up. When I used the cforms icon in the first row of icons in the "Visual" editing field (which I hadn't noticed before!), it worked. I'll be posting a cforms update shortly. (Actually, inserting what I call the "old code" while in HTML mode should work, as well).#6 by colm flanagan - February 9th, 2010 at 05:35
i am having the same problem, is there a solution??i dont follow the icon in "visual editing" part..could you explain..thanks..
#7 by timware - February 9th, 2010 at 09:41
In WordPress admin, insert this into the page/post, making sure you're in "HTML" editing mode and NOT "Visual" editing mode:
<!--cforms name="ContactForm"-->Change "ContactForm" to whatever you named your form in the cforms settings.
#8 by Carol Ann - December 11th, 2009 at 13:39
I've been using Cforms for awhile now and was playing around with my website and deactivated it noticed how much my website sped up. So question?
Is there a way to take the form you create in Cforms and make it static and unistall the plug-in?
#9 by admin - December 11th, 2009 at 13:54
Very interesting re the speed issue. I'll have to do some comparisons! The cformsII plugin is pretty complex, built on php and, I believe, ajax, and I really can't advise as to how you'd keep the displayed form but change the back end, and if all that would result in better performance, particularly if you wanted to retain many of its features. HTH.
#10 by larry - February 24th, 2010 at 15:36
hi,
I am a coder but a WP neewbie. I created a cform with plugin and very impressed. My question is I added the captcha but its not showing up? is there something I need to add somewhere. I know vague question but curious..
#11 by admin - February 24th, 2010 at 15:55
Hi Larry, I don't really have the bandwidth to support cforms. I suggest you check the cforms forum. I've not had a problem with the captcha not showing up. Best of luck!
#12 by larry - February 24th, 2010 at 15:36
does it mean anything that the captcha field name is in red?
#13 by admin - February 24th, 2010 at 15:58
Probably. Did you check the "Global Settings" in the cforms II settings area? I know my captcha fields aren't in red.
#14 by Auditions - April 28th, 2010 at 09:43
I am trying to change the reply-to email in the header of the form being submitted. I assume this can be done in the phpmailer file. Any tips on where in the file?
#15 by Tyler Young - May 5th, 2010 at 14:53
I usually submit 300 word articles on article directories to help me gain backlinks and readers.;.,
#16 by raja - July 12th, 2010 at 08:07
hi, i am new to wordpress, i am using cforms . i tried to add captcha . i got below error.
"It seems that your ROOT directory for WordPress is /wordpress-3.0/wordpress. cforms tried to auto-adjust its settings accordingly, however if you still encounter issues with Ajax (form submission & CAPTCHA reset) please open the file js/cforms.js in your cforms plugin folder and check the sajax_uri variable. (After changing the file, please emtpy your browser cache!) "why do i get this error, captcha field is not displayed in my cforms .
help me plz..