Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Nov 2010
    Posts
    390
    Thanks
    48
    Thanked 1 Time in 1 Post

    Question How to show the password input value as normal text?

    Hello,

    Below is a basic login area;

    Code:
    <input type="text" name="log" id="log" value="Username" />
    <br />
    <input type="password" name="pwd" id="pwd" value="Password" />
    How can I show my password value as "Password" and not the, not sure what their called, looks sort of like bullet points?

    Best Regards,
    Tim

  • #2
    New Coder
    Join Date
    Aug 2012
    Location
    Finland
    Posts
    23
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Code:
    <input type="password" />
    Is for making those dots, so just use like you used on first line:
    Code:
    <input type="text" />
    Btw, why do you wanna show text in password field?

  • #3
    Regular Coder
    Join Date
    Nov 2010
    Posts
    390
    Thanks
    48
    Thanked 1 Time in 1 Post
    Quote Originally Posted by ECoode View Post
    Code:
    <input type="password" />
    Is for making those dots, so just use like you used on first line:
    Code:
    <input type="text" />
    Btw, why do you wanna show text in password field?
    I don't, I only want to show the value="Password" as text, however, what they type I'd like to be seen as dots.

  • #4
    Regular Coder
    Join Date
    Jul 2012
    Location
    London
    Posts
    473
    Thanks
    4
    Thanked 86 Times in 86 Posts
    The code you're looking for this is

    Code:
    <input id="username" name="username" class="input_text" type="text" placeholder="Username"  />
    <input id="password" name="password" class="input_text" type="password" placeholder="Password" />
    You want to be able to see Password but when they type you want bullet points.

    The code above will do that

  • Users who have thanked tempz for this post:

    MrTIMarshall (08-02-2012)

  • #5
    New Coder
    Join Date
    Aug 2012
    Location
    Kalamazoo, MI
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tempz View Post
    The code you're looking for this is

    Code:
    <input id="username" name="username" class="input_text" type="text" placeholder="Username"  />
    <input id="password" name="password" class="input_text" type="password" placeholder="Password" />
    You want to be able to see Password but when they type you want bullet points.

    The code above will do that

    He is absolutely correct, that is what must be done to achieve this... however this will ONLY work with HTML5. The "placeholder" attribute is an HTML5 attribute.

  • #6
    New Coder
    Join Date
    Aug 2012
    Location
    Finland
    Posts
    23
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by MrTIMarshall View Post
    I don't, I only want to show the value="Password" as text, however, what they type I'd like to be seen as dots.
    Sorry I didn't understand the problem!
    and I see you already got answer!
    ~Peace

  • #7
    Regular Coder
    Join Date
    Nov 2010
    Posts
    390
    Thanks
    48
    Thanked 1 Time in 1 Post
    Quote Originally Posted by tempz View Post
    The code you're looking for this is

    Code:
    <input id="username" name="username" class="input_text" type="text" placeholder="Username"  />
    <input id="password" name="password" class="input_text" type="password" placeholder="Password" />
    You want to be able to see Password but when they type you want bullet points.

    The code above will do that
    Thank you very much for your help, I didn't know about the placehoder before and it will become very useful!

    Thank you to everyone else who posted too!

  • #8
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,695
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    As said, the placeholder attribute is HTML 5, and as such is not supported in some browsers, most notably current versions of Internet Explorer.

  • #9
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    If you want it to work in browsers that don't understand HTML 5 then you have to use JavaScript to swap the type of the field or (for IE8 and earlier) to swap the entire field.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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