Forms question

They have: 8 posts

Joined: Aug 2001

I'm wondering how the following is done:

I have a single form field for a newsletter subscription, within the code that form field has value="Enter your email".

What im after is, when someone clicks that box to enter their email i would like the 'value' text to disappear instead of making the visitor highlight/delete it themselves before writing their address in.

Anyone know the coding for this?

Thanks

AndyB's picture

They have: 344 posts

Joined: Aug 1999

modify to suit your variable and form name

disaster-master's picture

She has: 2,154 posts

Joined: May 2001

Go to Visual Tutorials. They have some good tuts on how to build froms.

http://visualtutorials.com/index.htm

disastermaster

They have: 8 posts

Joined: Aug 2001

hey, thanks very much for the help u2

cheers

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

hey,

dunno if you've already got a solution but heres an idea to any other readers:

use the onFocus event to change the value of the textbox. this will not only change it when it is clicked on but also when the user selects the box by using the keyboard (tab). Laughing out loud

<input type="text" name="email" size="20" value="your e-mail" onFocus="this.value=''">
'

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.