Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form field mask

Status
Not open for further replies.

superfly404

Technical User
Feb 1, 2005
24
0
0
US
What code would I use to create a simple form field mask just like the one on ebay.com in the search field at the top of the page where it says "Start new search"

I just want a script that enters that text into the form field, but makes it disappear when you click on the field.
 
Try this...

<input type="text" value="Start new search"
name="txt1" id="txt1" onkeypress="document.getElementById('txt1').value='';"
/>

 
IMHO it would be better to clear it as soon as the field is focused:

<input
type="text"
value="Start new search"
name="txt1"
onfocus="this.value='';"
/>

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top