Clear Text On Input Field On Click
Ever wanted to add text to your input fields and have it disappear when your visitor starts adding their info?
Better still, have it reappear if the visitor adds nothing?
Like this:
Here’s the code:
<input type="text" name="field-name-here" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'Enter Email To Get Updates':this.value;" value="Enter Email To Get Updates" />
Replace Enter Email To Get Updates with your own text.
Just a simple technique which works great.
Tags: Clear Text, Code, Input Field, Javascript, On Click, OnClick

Turn Ordinary Sales Letters Into The Extraordinary!
You'll Save A Ton Of Time And Money, Plus Explode Your Sales With The Sales Letter Graphics Pack! Find Out More
Related Posts
- A Little Hack to Get Your Password Back
This can either be a very useful or a very dangerous trick... - CForms II - The All In One Contact Form Solution
Cforms II is a Wordpress plugin which makes it easy for you... - Adding Live Preview For Comments
If you scroll down you will see a live preview option for... - Adding Code To Your Wordpress Post
Trying to add code to your wordpress post can be one of... - Separate Your Trackbacks From Your Comments
It is amazing how many blogs do not do this. They have...




Krystine says:
Reply
On September 15th, 2008 11:41 am
Thanks for the post. Really liked the idea will include this in my website.
Roger Hamiltone says:
Reply
On October 3rd, 2008 12:20 pm
Great post. Thanks for sharing the code.
Taylor from Adobe Flex Classes says:
Reply
On November 19th, 2008 3:31 pm
That is a very good breakdown of how to input text on an input field. I will add this to my website right away.