简体   繁体   中英

How to disable save password pop up on form submit in firefox using javascript

I need to submit a form without any popup appearing in the browser for save passwords. It is not working in Firefox 59 version.

I am trying to login a form which has two password input fields as below:

<input type="password" name="logonKey" maxlength="20" size="8" />
<input type="password" name="password" maxlength="100" size="12" />

I tried with adding autocomplete="off" (doesn't work) and adding readonly and onfocus="this.removeAttribute('readonly');" (doesn't work) attribute in the elements. But these are not working in Firefox as it is still showing popup of save password.

Kindly help me out a solution for this as I am stuck with going forward.

Most browsers currently ignore the autocomplete="off" tag, as it's now considered a best practice to let the browser remember the password for the user...

More information here

...in-browser password management is generally seen as a net gain for security. Since users do not have to remember passwords that the browser stores for them, they are able to choose stronger passwords than they would otherwise.

  1. If a site sets autocomplete="off" for a form, and the form includes username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits the page.
  2. If a site sets autocomplete="off" for username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits the page.

This is the behavior in Firefox (since version 38), Google Chrome (since 34), and Internet Explorer (since version 11).

If an author would like to prevent the autofilling of password fields in user management pages where a user can specify a new password for someone other than themself, autocomplete="new-password" should be specified, though support for this has not been implemented in all browsers yet.

 <input type="password" name="logonKey" maxlength="20" size="8" autocomplete="off"/> <input type="password" name="password" maxlength="100" size="12" autocomplete="off"/>

Add AutoComplete off on your form tag as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM