Want to know when there are new posts?

SUBSCRIBE VIA EMAIL

SUBSCRIBE VIA RSS

Sep 13th

Clear Text On Input Field On Click

Topics: Code

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: , , , , ,



RSS Feeds

Sales Letter Graphics

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

3 Responses to “Clear Text On Input Field On Click”


  1. Krystine says:

    Reply

    Thanks for the post. Really liked the idea will include this in my website. :)

  2. Great post. Thanks for sharing the code.

  3. Taylor from Adobe Flex Classes says:

    Reply

    That is a very good breakdown of how to input text on an input field. I will add this to my website right away.

What Do You Think?

Enter your name as YourName@YourKeywords and YourKeywords will be used as the anchor link to your website. Psst this gives you Page Rank advantage.

  1. (required)
  2. (required)
  3. (required)

Comment Preview:

Just in case you wanna see.

You can also subscribe to comments via RSS Comments RSS