English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm making a simple form with two text fields for a log in. i want text inside the text field to say "email address here" and the other one say "password here."

The thing is I got the text in there, but I want the text to disappear when you click inside the field. This way, the user doesnt have to backspace to get rid of the text. make sense?

here's my code so far...








2006-08-24 15:45:48 · 5 answers · asked by olympikdude 4 in Computers & Internet Programming & Design

5 answers















2006-08-24 15:56:32 · answer #1 · answered by LorettoBoy 4 · 0 1

not sure you can do that with form code... perhaps java script

however is there a way to make the text automatically highlight when they click on the box? if so then more savy users will begin tying and the orignal text will delete when they start inputing their name and password...

good luck

2006-08-24 15:51:50 · answer #2 · answered by Identity Crisis 3 · 0 1

You could have a "Clear Form" button that eaither causes the server to send out a blank one or calls a javascript function to clear the text.

2006-08-24 15:57:13 · answer #3 · answered by sheeple_rancher 5 · 0 0

you need to add some javascript:

onfocus="if(this.value=='email address here'){this.value='';}"

add this to the input tag for the text field.

for the password one, it would be best if you used "password" as the input type, that way the entry would be hidden as they enter it but you should be able to do similar to above.

2006-08-24 15:53:08 · answer #4 · answered by John J 6 · 0 0

never seen that before...nice upgrade

2006-08-24 15:49:31 · answer #5 · answered by micahc2003 2 · 0 1

fedest.com, questions and answers