Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: onclick text in form fields
08-10-2010, 09:53 PM #1
- Join Date
- Jun 2010
- Thanked 0 Times in 0 Posts
onclick text in form fields
I've created two form fields (username, password).
When a user comes to the page, the word "Username" is shown in the first form field. The word "Password" is shown in the second field. When a user clicks inside the field, the word inside the field erases automatically, allowing them to type in their username.
Everything above is working, except I'm running into some problems.
I need to figure out a way to include an if statement, that displays "Username" once again, if they did not type anything in the username field, and they clicked outside of the field. This will be the case for the Password field as well.
If a user types in their username in the username field, then types in their password, but clicks on the Username field once again to fix a typo, it completely erases their username from the field, making them have to type it all again.
I've included my code below. Thanks!
Any help appreciated :banghead: