initial value in field that disappears when clicking on it, how?

  • Thread starter Thread starter Jim S.
  • Start date Start date
J

Jim S.

I have created a form, that enters the info i a databse. I would like to be
able to see a dimmed (if possible) value in the fields that diappears when i
click on the field to enter some data.
how can i do that?
thanks
Jim
 
-----Original Message-----
I have created a form, that enters the info i a databse.
I would like to be able to see a dimmed (if possible)
value in the fields that diappears when i click on the
field to enter some data. how can i do that?

You would have to program this in JavaScript. Here's a
simplistic example:

<input type="text" name="T1" size="20" value="type here"
onFocus="this.value=''">

Unfortunately, this code blanks out the text box every
time the visitor clicks it. So if the visitor typed
Shpeling and then went back to correct it, the whole text
box would blank out again.

Also, unless you want to receive a lot of form submissions
stating "type here", you'll need to write more code that
guards against this.

That's why most designers put the promtp message above the
box rather than in it.

Jim Buyens
Microsoft FrontPage MVP
(e-mail address removed)
http://www.interlacken.com
Author of:
*------------------------------------------------------*
|\----------------------------------------------------/|
|| Microsoft Office FrontPage 2003 Inside Out ||
|| Microsoft FrontPage Version 2002 Inside Out ||
|| Web Database Development Step by Step .NET Edition ||
|| Troubleshooting Microsoft FrontPage 2002 ||
|| Faster Smarter Beginning Programming ||
|| (All from Microsoft Press) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
Back
Top