Tagged: ‘OnClick’

IN Code

Clear Text On Input Field On Click

posted Saturday, September 13th, 2008

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.
continue reading…