Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable form autofill in Chrome without disabling autocomplete [duplicate]

How can we disable Chrome's autofill feature on certain <input>s to prevent them from being automatically populated when the page loads?

At the same time I need to keep autocomplete enabled, so the user can still see the list of suggestions by clicking on the input or typing in it. Can this be done?

EDIT: Feel free to use plain Javascript or jQuery if you feel it is necessary or you feel like it would make your solution simpler.

like image 369
Elias Zamaria Avatar asked Jun 07 '12 19:06

Elias Zamaria


People also ask

How do I stop autocomplete in form?

Add autocomplete="off" onto <form> element; Add hidden <input> with autocomplete="false" as a first children element of the form.

How do I stop textbox from auto filling?

Click the Display tab. Do one of the following: To enable AutoComplete for the text box, select the Enable AutoComplete check box. To disable AutoComplete for the text box, clear the Enable AutoComplete check box.

How do I remove Autofill Chrome address bar suggestions?

Then, when the unwanted autocomplete suggestion appears, use your keyboard's arrow keys to highlight the suggestion in the drop-down menu below the address bar. Finally, press Shift + Delete and poof! The suggestion disappears. On a Mac, you may have to press Shift + Fn + Delete .


1 Answers

Here's the magic you want:

    autocomplete="new-password" 

Chrome intentionally ignores autocomplete="off" and autocomplete="false". However, they put new-password in as a special clause to stop new password forms from being auto-filled.

I put the above line in my password input, and now I can edit other fields in my form and the password is not auto-filled.

like image 142
Mirror318 Avatar answered Sep 21 '22 22:09

Mirror318