Jack Nicholson Jack Nicholson - 1 year ago 41
CSS Question

Explicitly state input box is not for usernames/logins

Chrome is autofilling a box on a form on a website with the login username and when you submit the form it asks to save the login.

How can I force Chrome to leave the input field alone?

It's trying to be too smart for its own good.

<input type="text" placeholder="(Optional)" name="auth_code" />

It auto-fills with the login username:

enter image description here

I tried adding


But the field still auto-fills with the login username on page load.

Another note:

I already have


But Chrome still auto-fills it.

$(document).ready(function() {


    setTimeout(function () {


    }, 100);

This code runs twice, just in case there's a browser-specific issue. It will definitely clear the input and requires jQuery, which may or may not be an issue for you. I also added an ID to reference the input element.

<input id="TheInput" type="text" placeholder="(Optional)" name="auth_code" />