What would cause Chrome autofill to stop working?

后端 未结 6 1435
既然无缘
既然无缘 2021-01-04 09:02

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.

6条回答
  •  别那么骄傲
    2021-01-04 09:54

    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:

    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

提交回复
热议问题