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.

Where do Google Display Ads appear

By Dave Fogel | December 20, 2022

Google display ads can appear on a variety of websites and platforms that are part of the Google Display Network. The Google Display Network is a vast network of websites that have partnered with Google to display ads. When you run a display ad on the Google Display Network, your ad may appear on any…

Are Google ads expensive?

By Dave Fogel | December 20, 2022

The cost of Google Ads will vary depending on the type of campaign and the targeting options selected. However, Google Ads is generally not considered to be an expensive platform for businesses. The platform offers businesses access to powerful analytics and reporting tools, allowing them to track the performance of their campaigns and optimize their…

Can Google Ads be profitable?

By Dave Fogel | December 20, 2022

Yes, Google Ads can be very profitable for businesses. Google Ads is an effective platform for businesses of all sizes, providing them with the tools they need to reach their target audiences, engage with potential customers, and track the performance of their campaigns. With Google Ads, businesses can ensure that their ads are seen by…

Posted in

Dave Fogel

Leave a Comment