Alex Rivera | Logout

What would cause Chrome autofill to stop working?

Asked 2011-08-30T19:10:25.337
12

I've got a new site we're working that uses HTML5. Everything validates except for the LESS stylesheets and the Facebook tags. However, Chrome will not autofill properly. If I type 'chr' in the first name field, I get the standard Autofill drop down beneath it, but highlighting, clicking, or otherwise selecting the autofill option does not complete the form as it should. The autofill dropdown merely goes away.

I'm guessing there's something in my HTML that is confusing the autofill code, but I can't seem to find any information on the web about Chrome's autofill implementation and things to look for when it doesn't work.

Edit: I know Autofill is working properly because it works on other sites, even other sites we've developed. It's got to be something specific to the HTML on this site.

Edit
Report

1 Answer

17

Chrome will not save password or autocomplete data if a form is submitted asynchronously. For example, if you submit the following form, Chrome will prompt you to save the password:

<form action="/signin">
    <input type="text" name="email" />
    <input type="password" name="password" />
    <button type="submit">Sign In</button>
</form>

However, if you bind to the submit event and override the default behavior, there will be no prompt and the autocomplete data won't be saved:

$(function(){
    $('form').submit(function(e){
        e.preventDefault();
        $.post($(this).attr('action'), $(this).serialize());
    });
});

Tested in 20.0

answered 2012-07-31T18:08:05.460

Your Answer