I'm having a hard time figuring out how Firefox and Chrome determining what fields are for a password and how they autocomplete them on other forms.
For my login form, I have this:
<p>
<label for="login_email">Email:</label><br />
<input id="login_email" name="login[email]" size="30" type="text">
</p>
<p>
<label for="login_password">Password:</label><br />
<input id="login_password" name="login[password]" size="30" type="password">
<input id="login_password_hash" name="login[password_hash]" type="hidden">
</p>
<p>
<input id="login_submit" value="LOGIN" type="submit">
</p>
The login_password_hash
field is for hashing the password on client side before sending using Javascript, having Javascript disabled does not change the outcome.
And for creating a new user, I have this form:
<p>
<label for="user_email">Email:</label>
<input id="user_email" name="user[email]" size="30" type="text">
</p>
<p>
<label for="user_first_name">First Name:</label>
<input id="user_first_name" name="user[first_name]" size="30" type="text">
</p>
<p>
<label for="user_last_name">Last Name:</label>
<input id="user_last_name" name="user[last_name]" size="30" type="text">
</p>
<p>
<label for="user_password">Password:</label>
<input id="user_password" name="user[password]" size="30" type="password">
<input id="user_password_hash" name="user[password_hash]" type="hidden">
</p>
<p><input id="user_submit" value="Create User" type="submit"></p>
Now after saving the password from the login form and visiting the new user form, the saved email is put in the last field before the password field and puts the password in the password field.
This happens on Firefox and Chrome, but not in Internet Explorer. Any ideas on why Firefox and Chrome behave this way? The two forms have nothing in common, the names and ids are all different.