$(document).ready(function() {
// #login-box password field
$('#password').attr('type', 'text');
$('#password').val('Password');
});
This is supposed to change the #password
input field (with id="password"
) that is of type
password
to a normal text field, and then fill in the text “Password”.
It doesn’t work, though. Why?
Here is the form:
<form enctype="application/x-www-form-urlencoded" method="post" action="/auth/sign-in">
<ol>
<li>
<div class="element">
<input type="text" name="username" id="username" value="Prihlasovacie meno" class="input-text" />
</div>
</li>
<li>
<div class="element">
<input type="password" name="password" id="password" value="" class="input-text" />
</div>
</li>
<li class="button">
<div class="button">
<input type="submit" name="sign_in" id="sign_in" value="Prihlásiť" class="input-submit" />
</div>
</li>
</ol>
</form>
This will do the trick. Although it could be improved to ignore attributes that are now irrelevant.
Plugin:
Usage:
Fiddle:
http://jsfiddle.net/joshcomley/yX23U/
I guess you could use a background-image that contains the word "password" and change it back to an empty background-image on
.focus()
..blur()
----> image with "password".focus()
-----> image with no "password"You could also do it with some CSS and jQuery. Have a text field show up exactly on top of the password field, hide() is on focus() and focus on the password field...
Just create a new field to bypass this security thing:
use this one it is very easy
Try this
Demo is here
Here is a little snippet that allows you to change the
type
of elements in documents.jquery.type.js
(GitHub Gist):It gets around the issue by removing the
input
from the document, changing thetype
and then putting it back where it was originally.Note that this snippet was only tested for WebKit browsers – no guarantees on anything else!