WordPress Plugin: JACF – Just Another Contact Form

Screenshots | Preview | Download latest Version (2.0)

Changelog

  • 1.0 (07/03/07): initial version
  • 1.01 (08/03/07): minor documentation added
  • 2.0 (15/07/07): PHP and JavaScript reworked due to some security flaws

Description

As I needed a contact form on my blog page (and for practicing how to develop a WordPress plugin) I came up with the idea to develop a simple plugin form that just displays a nice and easy contact form on my page. I had a look at what has already been done on the WordPress plugin page and found Contact Form ][ by Chip Cuccio.

From my perspective, this served as a perfect starting point for me to learn how to develop a plugin. I started with taking a look at Chip's code, what he did where and why. With this in mind, I started developing my own version, which I called JACF, which is short for "Just Another Contact Form". Nice and easy acronym, at least I hope so.

The following things were important to me:

  • Simple form with Name, Email, Website, Subject and Message field.
  • Only a few basic options in WordPress admin panel.
  • Validation strategy: if JavaScript is enabled, some validation is done on the client side before the form gets submitted. If JavaScript is not available, for some reason, a more sophisticated validation should happen on the server, which means it degrades gracefully.

Functionality

The plugin can be put on any page by using the Quicktag [ CONTACT-FORM ] on any page you like (without the spaces). The plugin then replaces the QuickTag with the form. It displays a form with the following fields:

  • Name
  • Email Address
  • Web Address
  • Subject
  • Message
  • Spam Protection Field

The following fields are required and get checked (client & server):

  • Name
  • Email Address
  • Message
  • Spam Protection Field

Installation Instructions

  1. Download the zip-file and extract the content to wp-content\plugins.
  2. Login to your WordPress AdminArea and activate the plugin in "Plugins > Plugins"
  3. Go to "Options > JACF" and click on "Update" to initially activate the basic settings for the plugin
  4. Edit the page where you want to put the contact form and insert the QuickTag [ CONTACT-FORM ] at the respective location where you want to insert the form on this particular page. And you're done!

WordPress Admin Options

After activation of the plugin, you can find the following simple configuration options in "Options > JACF" (screenshot).

Email Settings

  • Email Address: where should be form data get send to
  • Subject Prefix: you can add a prefix at the beginning of the subject to make it easier to indicate a message from your contact form on your WordPress page

Message Settings

  • Several Settings concerning success & error messages that get displayed on the page

Tested on

  • FireFox 1.5x
  • IE6

Credits

As stated above, credits go to Chip Cuccio for providing a great example by developing his Contact Form ][. Thanx Chip!

ToDo

  • Internet Explorer: Error Messages get displayed inline, but unstyled for some reason. Could this be a problem due to the lack of CSS support when inserting code on the fly?

Switch to our mobile site