1

When I enter to my login page the login form is filled automatically without even typing anything, this is pseudo-code

<li>
    <div class="form-group">
        <label for="email" class="required"><?php echo $this->__('Email Address') ?> <em>*</em></label>
        <input type="text" name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />
    </div>
</li>
<li>
    <div class="form-group">
        <label for="pass" class="required"><?php echo $this->__('Password') ?> <em>*</em></label>
        <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />
    </div>
</li>

How can I prevent this autofill, I have tested with jquery disable autocomplete plugin and it does not work

Thanks in advance

3
  • add autocomplete="off" attribute on the inputs.
    – Marius
    Commented Feb 14, 2020 at 10:39
  • You may need to use autocomplete="new-password" for the password field since a log of browsers ignore off on password fields. developer.mozilla.org/en-US/docs/Web/Security/…
    – Sam
    Commented Feb 14, 2020 at 10:47
  • just for information both fields email and password get filled once the page is reloaded Commented Feb 14, 2020 at 11:26

1 Answer 1

0
<form name="form1" id="form1" method="post" 
  autocomplete="off" action="http://www.example.com/form.cgi">

This will work in Internet Explorer and Mozilla Firefox, the downside is that it is not XHTML standard.

1
  • Thanks for this I have tested it but It does not work Commented Feb 29, 2020 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.