Jump to content

Text inside form passwords


SamohtVII

Recommended Posts

I am looking to have text in my login forms like this page: http://www.hontour.com/index/ but I can't get it to say password it will just bring up the **** instead. I have got the username kind of working but I want it to clear whenever someone clicks into it as well.

<i>Username: </i><input id="username" type="text" name="username" onfocus="if(this.value == '') { this.value = ''; }" value="Username"> <i>Password: </i><input id="password" type="password" name="password" value="password">

Link to comment
Share on other sites

Here is the password element from the hontour site. Notice the placeholder attribute:

<input id="loginbar_password" type="password" placeholder="password" name="password">

That's all you really need. It doesn't work in older browsers, but this functionality is nice, not essential.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...