title: How does the browser decide which form fields are username/password?
body: <p>Modern browsers save passwords. Which criteria affect this decision?</p>
  
  <p>Background:</p>
  
  <p>I have a registration page with the following form:</p>
  
  <pre><code>    &lt;form action="/BlaBla/Account/Register" method="post"&gt;
      &lt;div&gt;
          &lt;fieldset&gt;
              &lt;legend&gt;Account Information&lt;/legend&gt;
              &lt;p&gt;
                  &lt;label for="username"&gt;
                      Username:&lt;/label&gt;
                  &lt;input id="username" name="username" type="text" value="" /&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  &lt;label for="email"&gt;
                      Email:&lt;/label&gt;
                  &lt;input id="email" name="email" type="text" value="" /&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  &lt;label for="invitationCode"&gt;
                      Invitation Code:&lt;/label&gt;
                  &lt;input id="invitationCode" name="invitationCode" type="text" value="" /&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  &lt;label for="securityQuestion"&gt;
                      Security question:&lt;/label&gt;
                  &lt;input id="securityQuestion" name="securityQuestion" type="text" value="" /&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  &lt;label for="securityAnswer"&gt;
                      Security answer:&lt;/label&gt;
                  &lt;input id="securityAnswer" name="securityAnswer" type="text" value="" /&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  &lt;label for="password"&gt;
                      Password:&lt;/label&gt;
                  &lt;input id="password" name="password" type="password" /&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  &lt;label for="confirmPassword"&gt;
                      Confirm password:&lt;/label&gt;
                  &lt;input id="confirmPassword" name="confirmPassword" type="password" /&gt;
              &lt;/p&gt;
              &lt;p class="buttons"&gt;
                  &lt;input type="submit" value="Register" /&gt;
              &lt;/p&gt;
          &lt;/fieldset&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>Mozilla seems to think that the fields <code>securityAnswer</code> and <code>password</code> are the user/pw fields, with awkward consequences (security answer stored as username is bad).</p>