开发者

How can I make my password fields always empty?

开发者 https://www.devze.com 2022-12-30 06:21 出处:网络
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?

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

精彩评论

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

关注公众号