Clearing Input Forms with Contact Form 7

Many websites today will not have labels next to their input boxes anymore. Instead they place the text inside the input box. Contact Form 7 plug in can do this out of the box, but the user has to erase what is in the box before they can type in their information. This is a) annoying and b) not user friendly at all. Fortunately there is a hack that makes this work. Special thanks to emj for this solution.

Note that this is a bit of a hack, so not sure how it will work as you upgrade to newer versions.

First: add this javascript to header.php


Second: in the contact form 7 plugin folder, edit file /modules/text.php

Third: find line 76
$html = ‘‘;

Fourth: between ‘input’ and ‘type’, add:
onFocus=”clearText(this)” onBlur=”restoreText(this)”

That should do it. It isn’t perfect, but it works pretty well.

Quick WP Menu Tip

By Dave Fogel | January 10, 2011

If you do not want the Parent Menu items clickable, create a custom menu item and link it to “#” (no quotes). Then put your other menu items under that one.

Creating sidebar widgets for Menus in WP 3.0

By Dave Fogel | January 10, 2011

Creating Side Bar widgets for Menus in WordPress 3.0 So you want to add sidebars to your website and do them dynamically. I am sure there are many ways to do this, but here is how I do it. You need FTP access to your wordpress site to do this. I use Dreamweaver to edit…

Upgraded to WordPress 3.0

By Dave Fogel | June 18, 2010

We have just upgraded the site to WordPress 3.0. If you see anything broken, rest assured we are working on fixing it. We look forward to all wordpress 3.0 has to offer the community and your websites.

Posted in

Dave Fogel

Leave a Comment