0

For a reason I cannot determine, the password field is being populated when the form is submitted. This only happens in Firefox.

This is my form.

<form action="index.php/admin/settings/account" autocomplete="off" method="post">
  <section>
    <label for="email">Email</label>
    <input type="text" name="email" value="test@test.com" autocomplete="off" />                     
  </section>
  <section>
    <label for="password">Password</label>
    <input type="password" name="password" value="******" autocomplete="off" />                     
  </section>
  <section>
    <label for="confirm_password">Confirm Password</label>
    <input type="password" name="confirm_password" value="******"  />                       
  </section>
  <section>
    <input type="submit" name="save" value="Save"  />
  </section>
</form>
<script>
    console.log($('input[name="password"]').val());
    $('form').submit(function(e) {
        e.preventDefault();
        console.log($('input[name="password"]').val());
    });
</script>

As you can see. I have set the autocomplete="off" on both the form and the relevant fields. If I save the form without making changes. Autocomplete doesn't fire.

If I change the email address to an email with a saved password the password is changed when the form is submitted.

This is what I get in the console.

Firefox.

******
123123

Chrome

******
******

Has anyone come across this before? How do I stop this?

4

1 回答 1

0

Is there a reason you're not setting autocomplete="off" in the confirm password section? It seems to be the only section that you're not explicitly disabling that property.

于 2012-08-13T18:31:03.157 回答