Want to know when there are new posts?

SUBSCRIBE VIA EMAIL

SUBSCRIBE VIA RSS

Aug 3rd

CForms II - The All In One Contact Form Solution

Topics: All Things Wordpress Code

Cforms II is a Wordpress plugin which makes it easy for you to add a contact form to your website.

Once you install and activate the plugin, don’t get intimidated by the dozens of options available. It is pretty easy to set up. Click on CForms from your WP admin menu.

Click to view bigger image
Click to view the bigger image

Please match the steps to the above image:

  1. Select a contact form you want to edit. One form is pre-added for your convenience.
  2. Alternatively you can also use these links to select the form you want to edit.
  3. You can also add a new form or duplicate the current one.
  4. Change your form name here and click update settings (12).
  5. You can toggle AJAX settings on or off. You might want to do this to get CForms to work wither certain comment plugins. More on this later in the post.
  6. One of the most useful features is you can add form presets. These provide a great starting point for your form. Amongst these are the basic form, form with error messages, comment form replacement and a few other options. I suggest starting with the form with error messages for your contact form and the comment form if you want to replace your default comment form with CForms (yes you can do that).
  7. Add fields by entering the number you want add and clicking the plus sign.
  8. Next add a field name.
  9. Click on the little settings image next to the field name text box and it will give you a pop-up with all the options. This makes it easier to fill the options for that particular field.
  10. Select the type of field you want for example an input field, a checkbox, a dropdown, etc. You might want to go back to the last step to update the options if you change the field type.
  11. Choose from several options like making a field required, make it disabled, verify email address, make it read only, etc.
  12. Once you are happy with the form click on update settings to save it.

Once you have finished with the form above scroll down to the settings. These are specific to the chosen form so make sure you have selected the correct one.

Redirection, Messages, Text and Button Label

The first few options relate to form specific text and messages that need to be shown on your contact form (for example what text you want on your submit button). You can change them if you want but the default values are fine, too.

These are the values you might want to change. Message summaries comprise of both error messages and form submission success or failure messages. Choose whether to display this above or below your form. I personally suggest above the form.

Next choose if you want to use javascript to show the errors.

Fancy error messages add certain styling to the fields that are showing errors. You can change this styling but the default is pink.

This was one way of highlighting the fields giving errors. Another is to add the error message along with each field. Checking Embedded Custom Error Messages will do the trick.

Next set the limit on how many form submissions your visitor can make.

You don’t need to deal with the redirection fields unless you want your visitors to be redirected to a specific page after filling the form.

Using CForms as a Comment Form

Click on WP Comment Feature. It is the sixth option.

Select ‘Enable this form to optionally (user determined) act as a WP comment form’

Five new comment specific fields are added to your form once you do this.

Now go to form preset and choose the Comment Form preset. If you want you can add a captcha or Q&A verification field to deter spammers.

Next add:

<? insert_cform('comments'); ?>

in place of the regular comment form in your comments.php file. Replace comments with the name you choose for your comment form.

Your visitors should now be able to use the Cforms comment form to post a comment or send you a note.

If you have AJAX enabled on this form, then know that the page will not re-load once a comment has been added. Therefore the commentator will not see the comment styling you have added to comments.php until the page re-loads.

You can change the styling that gets shown until the page gets refreshed under the main menu for Global Settings. Choose ‘WP Comment Feature Settings’ and make changes to ‘New comment HTML template’

Enabling CForms Comment Form To Work With The Subscribe To Comments Plugin

Since this is a very widely used plugin, let me explain how you can add the the checkbox to subscribe to your Cforms comment form.

Select ‘Core Form Admin / Email Options’ and check the ‘Use custom input field NAMES & ID’s’.

This will enable you to add custom fields with their own specific values, id’s and names.

The subscribe to comments plugin needs a very specific checkbox with value, id and name equal to subscribe.

Now go up to your form and add a field. Here’s what you need to add to field name:

[id:subscribe]#Subscribe To Comments|subscribe

Let me explain. The [id:subscribe] adds subscribe as the name and id in the input tag for this checkbox. #Subscribe To Comments can be changed to whatever you want to display on your contact form next to the checkbox. Adding |subscribe adds subscribe as the value for the checkbox.

Note: You will have to turn AJAX off for this form as the subscribe to comments plugin does not work with AJAX on.

Also it will keep showing the checkbox to subscribe even when your visitor is subscribed. It won’t get swapped with the Manage Subscriptions link.

A workaround is to just add the subscribe to comments option outside of the comment form. This way people won’t have to leave a comment to subscribe either. Just add this line either to single.php or comments.php depending on where you want to place it.

<?php show_manual_subscription_form(); ?>

What about other plugins

I haven’t tried other plugins but for example the CommentLuv plugin uses the id, name and value ‘luv’ so it should work the same way as above.

AJAX and Comment Plugins
If you are using other comment plugins then it is a good idea to turn AJAX off. For example the WP AJAX Edit Comments also works better with AJAX turned off as you need to re-load the page to view the edit option.

If you have successfully used Cforms with other plugins then be sure to mention that via the comments.

In conclusion … Cforms is one of the most extensive plugins I have seen. The plugin author has not only worked on adding all the features one can think of and need in a contact form but has also worked on its presentation. It is a pleasure to use this plugin with all its features and design options.

And I have only covered some of these features. There are lots more features and settings you can tweak to your heart’s content including the ‘Tell-A-Friend Form Support’ and so much more.

So just install the plugin and enjoy.

Tags: , , , , ,



RSS Feeds

Sales Letter Graphics

Turn Ordinary Sales Letters Into The Extraordinary!

You'll Save A Ton Of Time And Money, Plus Explode Your Sales With The Sales Letter Graphics Pack! Find Out More

Related Posts

12 Responses to “CForms II - The All In One Contact Form Solution”


  1. thanks for the heads up! but i think i need some help on the AJAX part. I’ve already enabled it for my website, but then it doesn’t refresh after i insert a new comment.

    Where do I make the change? Is it in the comments.php, the single.php or in the Global Settings->WP Comment Feature Settings? If it’s in the Global Settings area, is it that I must change the new HTML Template’s id to match the one in the “parent comment container” field? or…?

    hope you can guide!

  2. First of all I will suggest upgrading to CForms 8.6.1 - some new feaures and bugfixes.

    As far as the comment not showing up in AJAX, yes you need to set up the template via Global Settings. Make sure the comment ID is the same as set in your comments.php file.

    I had ‘ol class=commentlist’ - that didn’t work. It needed to be ‘ol id = commentlist’
    You then add commentlist as the ID under Global Settings

    I am going too add a Part II to this tutorial with help on the new features (whih btw are great) and more info on adding the comment template (the latest version also has the gravatar option). Just give me a day or two.

  3. i can’t get mine to work, it keeps saying that my path is wrong, but i changed the path to the correct one, and it’s still not working :(

  4. Eric, Where did you change and what did you change it to?

  5. I’m the plugin author of Ajax Edit Comments. The author of cforms and I got together and made our plugins compatible with the AJAX feature enabled.

    To use the compatible versions, try v2.1.2 of AEC and v8.6.1 of cforms.

    Blog Post: How Much Do You Give Away?

  6. Ronald, thank you for the update. And really appreciate you guys coming up with great plugins.

  7. ron art

    So ive read this above tutorial as well as the help section on my dashboard. I configured CFormsII like the diagram above. Seemed simple and straight forward enough,

    I only want to use CFormsII as a “subscribe” form, but now I have no clue as to how to get it to show on my page.

    I have no idea what code im supposed to input.
    I have no idea as to where im supposed to find it
    And I have no idea where im supposed to put it.

    (scratches head, considering paying for a class in css and php. html was so much simpler)

  8. ron art

    Just for clarification:

    “I only want to use CFormsII as a “enter your email subscribe to my mailing list” form. NOT as a “subscribe to comment form”

  9. As far as adding CFORMS to your post or page goes you will see a button called CFORMs in your write page/post area. Use that to add your form.

    Are you just collecting email addresses or are you trying to add them to an autoresponder? The latter will not work as CFORMs does not post to third party services.

  10. cam

    this has really been helpful to me. thank you for the post. your comment form is also nice. i like the Comment Preview :)

  11. I’ve set up the form as above but dont see the button CFORM in the write page/post area.

    Am I missing something here?

  12. It’s not appearing in both the visual editor or the HTML editor?


What Do You Think?

Enter your name as YourName@YourKeywords and YourKeywords will be used as the anchor link to your website. Psst this gives you Page Rank advantage.

  1. (required)
  2. (required)
  3. (required)

Comment Preview:

Just in case you wanna see.

You can also subscribe to comments via RSS Comments RSS