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.

PPC vs SEO

By Dave Fogel | February 27, 2010

One of the most common questions we get asked is what is more important, Pay-Per-Click or Search Engine Optimization? Here is how we see it: PPC: – Ads are online almost immediately – Start getting ROI sooner – Great for time sensitive promotions – Great for testing different words, phrases and products – Quickly build…

Posted in

Dave Fogel

Leave a Comment