Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make my password fields always empty?

I have a form field where users can change their passwords, but if they set their settings to remember passwords, their password shows up. Is there a way to make the field always empty? So that they always have to type their password.

<label for="oldpassword" class="styled">Old password:</label>
<input type="password" id="oldpassword" name="oldpassword"/><br />
like image 581
ggfan Avatar asked May 16 '10 23:05

ggfan


People also ask

What does fields mean in password?

As another security precaution, a password field stores its value as an array of characters, rather than as a string. Like an ordinary text field, a password field fires an action event when the user indicates that text entry is complete, for example by pressing the Enter button.

How do you set the password field in the HTML document?

The <input type="password"> defines a password field (characters are masked). Note: Any forms involving sensitive information like passwords should be served over HTTPS. Tip: Always add the <label> tag for best accessibility practices!

What is autocomplete password?

Use autocomplete="current-password" and id="current-password" for the password input in a sign-in form, or the input for the user's old password in a change-password form. This tells the browser that you want it to use the current password that it has stored for the site.

What does autocomplete new password do?

If you are defining a user management page where a user can specify a new password for another person, and therefore you want to prevent autofilling of password fields, you can use autocomplete="new-password" .


1 Answers

You could clear the old password shortly after the page loads.

Using jQuery:

setTimeout(
    function() { $(':password').val(''); },
    1000  //1,000 milliseconds = 1 second
);
like image 76
SLaks Avatar answered Sep 24 '22 21:09

SLaks