0

Let's say I'm a very worried bank and I don't want my customers to use autofill for their online banking password.

I'd like to write a document.ready handler (or capture some other event) that would simply look like

document.ready = function() {
    $("#password").val("");
}

so that any value in the password will be cleared out when the document is fully loaded.

Is this likely to fire AFTER autofill has filled in the form? Or will some autofill plugins fire after the document is ready and fill in the password anyway?

Is there a Javascript event I can handle that represents the autofill logic occuring?

John Wu
  • 50,556
  • 8
  • 44
  • 80
  • possible duplicate of [Browser Autofill and Javascript triggered events](http://stackoverflow.com/questions/4938242/browser-autofill-and-javascript-triggered-events) – Evan Davis Jun 25 '14 at 19:24
  • There is also the `autocomplete='off'` attribute, though this is being [disabled in newer browsers](https://bugzilla.mozilla.org/show_bug.cgi?id=956906). – Evan Davis Jun 25 '14 at 19:28
  • some plugins dont fire until the input is clicked or focused, give up. keeping passwords from persisting actually lowers security, which is why browsers are fixing the behavior. – dandavis Jun 25 '14 at 19:30
  • Agree it's less secure for standard passwords. This is actually for OTP (one time password) and for other information used for authentication such as SSN. – John Wu Jun 25 '14 at 20:15
  • Possible duplicate of [Documentation of html dom Event object?](http://stackoverflow.com/questions/10636834/documentation-of-html-dom-event-object) – Paul Sweatte Mar 04 '17 at 04:14

0 Answers0