Disable browser autocomplete at HTML form field

There are many possible solutions to solve this problem. All solution almost same but one of them can work for you. Let me know what work for you.

Solution 1:

<input type="text" autocomplete="off" />

Solution 2:

<input name="pass" type="password" autocomplete="new-password" />

Solution 3:

When you always render autocomplete with random string, it will never remember anything.

<input name="name" type="text" autocomplete="rutjfkde">

Solution 4:

<form action='' autocomplete='off'>

Solution 5:

<input type="text" name="UserName" autocomplete="off" readonly 
    onfocus="this.removeAttribute('readonly');" >

Solution 6:

Instead of autocomplete="off" just simply use autocomplete="false"

Solution 6:

<input type="text" name="field" autocomplete="nope">

Solution 7:

Change the input type attribute to type="search". Google doesn’t apply auto-fill to inputs with a type of search.

<input type='search' name="whatever" />

Solution 8:

<input autocomplete="off" aria-invalid="false" aria-haspopup="false" spellcheck="false" />

Use all attributes

Source: Stackoverflow

Leave a Reply