PDA

View Full Version : How to show the password input value as normal text?



MrTIMarshall
08-01-2012, 09:02 PM
Hello,

Below is a basic login area;



<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

ECoode
08-01-2012, 09:34 PM
<input type="password" />
Is for making those dots, so just use like you used on first line:

<input type="text" />
Btw, why do you wanna show text in password field?

MrTIMarshall
08-01-2012, 10:14 PM
<input type="password" />
Is for making those dots, so just use like you used on first line:

<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.

tempz
08-01-2012, 10:21 PM
The code you're looking for this is



<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 :)

TylerB
08-01-2012, 10:31 PM
The code you're looking for this is



<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.

ECoode
08-01-2012, 10:43 PM
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

MrTIMarshall
08-02-2012, 01:08 AM
The code you're looking for this is



<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!

VIPStephan
08-02-2012, 01:19 AM
As said, the placeholder attribute is HTML 5, and as such is not supported in some browsers, most notably current versions of Internet Explorer.

felgall
08-02-2012, 11:10 PM
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.