IN Wordpress Plugins

CForms II – The All In One Contact Form Solution

posted Sunday, August 3rd, 2008

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.

  • http://www.jusuchin85.com/ Justin

    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!

  • http://www.dotsndashes.com Erum Munir

    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.

  • http://test eric

    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 :(

  • http://www.dotsndashes.com Erum Munir

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

  • http://www.raproject.com Ronald Huereca

    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?

  • http://www.dotsndashes.com Erum Munir

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

  • 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)

  • 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”

  • http://www.dotsndashes.com Erum Munir

    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.

  • http://www.camsdcute.com cam

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

  • http://designerjewellerybox.co.uk Tom S

    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?

  • http://www.dotsndashes.com Erum Munir

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

  • Olu

    Above, when you say “add in place of the regular comment form in comment.php, what piece of code am I looking for to replace? I’m not a coder and don’t know what the code for the comment form is. Am I replacing the entire content of the comment.php file?

  • http://www.dotsndashes.com Erum Munir

    The comment form will start with:
    <form … >

    and end with:
    </form>

  • Olu

    Thank you Erum. I found the code in the comment.php file and the form looks great.

    Thanks.

  • Olu

    When a person is not logged in and leaves a comment, it shows up as “Anonymous”, even if the person inputs their name in the Name field. How do I replace “Anonymous” with the person’s name like it does with your comments?

    Thanks – Olu

  • http://orange.pinkygirl.org design

    I could not find any other blog like this . I am sure the owner of this blog has make a lot of effort in order to make this useful post for visitor reading. Indeed this is a good effort and i really appreciate that. I will be coming here again in a while to look more info and to find out more news. This actually will earn some respect to the visitor when they read such a good info.

    Blog Post: Busby SEO TEST is now Recruiting

  • http://teamnirvana.com/blog/ Team Nirvana

    An awesome introduction to cforms.

    I had always considered to be cforms as extremely tough to monitor. But, after reading your step by step tutorial, it had been a piece of cake really.

    Thanks for writting.

    Blog Post: Air Traffic Is Exploding Around The World

  • Mike

    Hi. I search all the forum and solution but still can’t get it.
    What code should I replace in the form… /form? Is it like: “sorry I didn’t include the >< for the code”.

    ?php insert_cform(’1′); ?

    ol id=”commentlist”

    (And I paste the “default template code here too. Without changing the code.)

    Then the result is the “comment form” shown correctly but it didn’t show the comment when I submit.
    Where should I change?

    Thanks for the help.

  • http://www.dotsndashes.com Erum Munir

    @Mike, open comment.php and replace the code starting from for to /form with the cforms code i.e ?php insert_cform(’1′); ?

  • http://www.RonForster.com Ron Forster

    Great plug in and great write up. Just installed on a real estate site and install and a basic contact form were a snap. In the middle of making a custom form for a seminar sign up.
    Thanks again, and hope your team has a great holiday season.

    Blog Post: Metro light rail plans weekend grand opening events, free rides through Dec. 31

  • http://filmesportugueses.com Paulo

    Hi,
    I think this plug in is very good, but after installing it i can’t moderate the posts and they don’t show on the page!!
    I get message and see them on the tracking tab but thats it..
    could you please help me here?

  • http://www.dotsndashes.com Erum Munir

    That is really strange as cforms doesn’t have much to do with moderating posts. Does deactivating the plugin bring everything back to normal?

    If yes, then you might want to report a bug to the plugin author.

  • http://AttractionInternetMarketing.com Dotty

    I would like to put a download free report link in the success message. It does not seem to accept html and just putting the www format for the link does not make it clickable. Is there a way to have a download link displayed after they fill out the form?

  • http://www.dotsndashes.com Erum Munir

    You can set the form to go to a thank you page and place the download link there.

  • http://bb.nl derekD

    I would like to use a multipage form, where the second page depends on the answers of the first form. For example, on the first page i ask if the client is interested in A, B or C. So depending which box he checks, the next page should be different.
    Is it possible to configure this in cforms II?

  • gilad

    How can I submit a form from a mobile client app?

  • http://www.weighttrainingforwomentoday.com kathy

    Any ideas as to why

    results in a blank form.. w/ a blank submit button? when default is the name of one of my forms?

  • http://www.weighttrainingforwomentoday.com kathy

    i guess my code got stripped.. it should be:

    insert_cform(“default”);

    thanks!

  • Karencatangay

    The form is not showing up. Not sure why.  Does it have something to do with this note that displayed: It seems that your ROOT directory for WordPress is /test. 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!).  –But the thing is, I’m not techie and i’m having a hard time following this instruction.  Tried opening up the file but not sure how to “check” the sajax_uri variable.  Please help!

  • Karencatangay

    Also, can cforms do long registration forms? A client is asking me to do a 2-page registration form ( see attached image).  Can this be done using cforms?

  • Jai Lambert

    If I have built a form using cformsII on another WP Install, how do I get a new form on another WP Install to have the same fields (how can I export the settings of one to another)? I want to use the same form on another site but don’t want to have to set the whole thing up manually again.

  • Fuad0002

    most hard and un-user friendly plugins, just wast ur money and time with it, contact 7 or formidable is best.

blog comments powered by Disqus