开发者

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 th开发者_高级运维e 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 />


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

Using jQuery:

setTimeout(
    function() { $(':password').val(''); },
    1000  //1,000 milliseconds = 1 second
);


Use: autocomplete="new-password" attribute in the password input


nope. you cannot handle this browser behaviour.


<input type="password" name="my_password_field" autocomplete="off" />


Using jQuery:

$(window).load(function() {
    $("input[type=password]").val('');
});


You can do that like this:

Password:- <input type="password" name="name" placeholder="Enter your password" autocomplete="new-password" class="class" id="myInput">

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜