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.

The Jacksonville SEO Company For Your Business

By Dave Fogel | December 27, 2022

Looking for a Jacksonville SEO Company? You have come to the right place.  We have put together some helpful information about SEO that will hopefully answer some of the most common questions about SEO. What is SEO? An SEO (Search Engine Optimization) company helps businesses improve their visibility on search engines like Google, Bing, and…

What Are The Most Popular Facebook Ad Sizes?

By Dave Fogel | December 27, 2022

The most popular Facebook ad sizes are: 1200 x 628 pixels (1.9:1 aspect ratio): This size is recommended for most types of ads, including single image, carousel, and video ads. 1080 x 1080 pixels (1:1 aspect ratio): This square size is recommended for image and video ads that will be displayed in the news feed.…

Where Do Facebook Ads & Instagram Ads Appear?

By Dave Fogel | December 27, 2022

Facebook ads appear in a variety of places across the platform, including in the newsfeed, on the sidebar, and in Marketplace. In the newsfeed, ads are displayed alongside other posts from friends, family, and pages that have been liked. Ads are also displayed on the sidebar, where they appear alongside other suggested pages and posts.…

Posted in

Dave Fogel

Leave a Comment