0

I have a login form for my website with fields for email address and password. This works fine, and all browsers I've tested correctly autofill the fields.

I've recently added a checkbox input to the form, and the Chrome browser (Version 50.0.2661.94) no longer autofills the password field. The autocomplete attributes on the inputs are set according to the html spec. Chrome actually asks me if I want to save my password for the site, but still will not autofill.

As an experiment, I've tried changing the input type of the checkbox to "text" & other types, and autofill then works as expected. Safari & Firefox still autofill after adding the checkbox.

Unfortunately I can't seem to replicate this behavior in a jsfiddle, but hopefully someone can point out something I've missed. Here's a stripped down version of my form:

<html>
  <head>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.3/semantic.min.css" rel="stylesheet"/>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.3/semantic.min.js"></script>
  </head>
  <body>
    <form class="ui form" method="post" action="login">
      <input name="email" type="email" autocomplete="email" placeholder="Email" class="email-input">
      <input name="password" type="password" autocomplete="current-password" placeholder="Password" class="password-input">
      <input name="sharedComputer" type="checkbox">
        <span>I'm using a shared computer</span><br/>
      <input type="submit">
    </form>
  </body>
</html>
evan_schmevan
  • 1,591
  • 12
  • 19

1 Answers1

0

From this post it looks like this is nothing to do with type="checkbox". There are list of fields that chorme is trigger autofill.

But the credit here is to @kmote link

Community
  • 1
  • 1
The scion
  • 1,001
  • 9
  • 19
  • Good suggestions. As I mentioned, If I change the input type to any different type, the form completely autofills correctly. So I still think it has something to do with type="checkbox". I don't need Chrome to autofill the checkbox anyway - just email and password. I've tried adding the autocomplete attribute to my fields (I'm using react-js, and x-autocompletetype is not supported), and this partially works. Now my email address is being autofilled, but the password is not. – evan_schmevan May 12 '16 at 18:05