Stop browser from automatically filling in username and password fields

In the Chrome browser, I saved the username and password.

Now, if I go to some other form, and it contains a username and password for some other things, the one I saved is automatically populated here.

How can i stop this?

+11
source share
4 answers

If autocomplete=offit will not interfere with the filling of credentials, use the following command -

fix browser autocomplete in: readonly and set the writeble on focus function (click and tab).

 <input type="password" readonly onfocus="this.removeAttribute('readonly');"/>
+15
source

For the Fire fox browser, this is:

<input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;" />
<input type="password" name="password_fake" id="password_fake" value="" style="display:none;" />
<input type="password" name="password" id="password" value="" />

Chrome: autocomplete="new-password"

+6

Simple: there is an HTML5 attribute called autocomplete.

Just set it to off.

<input autocomplete="off"/>
+5
source

Please refer to the following:
https://www.chromium.org/developers/design-documents/create-amazing-password-forms and https://www.chromium.org/developers/design-documents/form-styles- that-chromium-understands

Try the following:

<form id="login" action="signup.php" method="post">
    <input type="text" autocomplete="username">
    <input type="password" autocomplete="new-password">
    <input type="password" autocomplete="new-password">
    <input type="submit" value="Sign Up!">
</form>
+1
source

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


All Articles