SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    May 2005
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Password field default value

    Hey there, I have a login form with email and password textfield boxes but instead of labels these need to have the default values of email and password inside the boxes themselves. The problem is, given that the password text field is of password type the default value appears as dots.

    Is there a way around this?

  2. #2
    SitePoint Evangelist hexburner's Avatar
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't change the type of an input field if it's of type=password, so you'll need to use some JS.
    You can use old.parent.replaceChild(new, old) to replace the textbox with the default value with a password inputbox on focus. If the password inputbox remains empty, replace the password inputbox back with the default textbox. If the password inputbox isn't empty, don't replace it.
    FOR SALE: 1 set of morals, never used, will sell cheap

  3. #3
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  4. #4
    SitePoint Zealot
    Join Date
    May 2005
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanx Kravitz again and keep up the good info!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •