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

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
 
J

Jim Buyens

-----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) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top