Lock password

Possible duplicate:
Disable the "Save Password" browser functionality

How can you block the password request to remember in HTML form? An example is PayPal, which does not allow you to save passwords.

I know that autocomplete must be turned off, and there is another trick to block autocomplete when the browser does not support the attribute (create a hidden field called password). These two methods do not work in blocking the browser from asking for a password.

+3
source share
2 answers

Submit a authrequest using Ajax, and then redirect JavaScript to success.

// in JQuery it would be like this
$.post({
    url: '/login.php', 
    data: 'username=test&pass=test', 
    success: function(data) {
        window.href='success.php'
    }
});

OR

(I have not tried it yet)

( DOM) ( ) , .

.

+1

javascript...

document.getElementById('usernameOrWhatever').setAttribute( 'autocomplete', 'off' )
-1

Source: https://habr.com/ru/post/1789511/


All Articles