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

  • add autocomplete="off" attribute on the inputs. – Marius Feb 14 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 Feb 14 at 10:47
  • just for information both fields email and password get filled once the page is reloaded – Ahmed C Feb 14 at 11:26
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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