-1

I simply want to get rid of password remembrance prompts on all browsers. what ive done is changed my <input type="password"> with <input type="text"> and used below jQuery,

<P>    
    <INPUT TYPE=text name="password" id="passfld" value="" size=20 autocomplete="off">
    <script>
        $(function(){                                               
            setTimeout(function(){
                $("input#passfld").attr("type","password");
            }, 10);
        });

This method doesn't seem safe to me, need some alternate method.

Cœur
  • 32,421
  • 21
  • 173
  • 232
Atif
  • 216
  • 3
  • 15
  • But, does it work? I ask, because the way I've done it is clunky as hell and I'm looking for a better way – Jaromanda X Jul 02 '15 at 13:07
  • I think the right thing to do is add `autocomplete`, `autocorrect`, and `autocapitalize` attributes to your `` elements, each with the value "off". Strictly speaking, if a browser really wants to autocomplete a password, you can't prevent that. – Pointy Jul 02 '15 at 13:08
  • Of course it did for me. – Atif Jul 02 '15 at 13:08
  • 1
    autocomplete tags doesnt work anymore for all latest browsers. – Atif Jul 02 '15 at 13:09
  • Right, they don't. Allowing people to use browser password managers is a *good* thing for security; that's why browsers are changing. – Pointy Jul 02 '15 at 13:09
  • @pointy - what would autocorrect or autocapitalize do? And, you can defeat password saving. password saving in a browser is a TERRIBLE thing – Jaromanda X Jul 02 '15 at 13:10
  • @JaromandaX well you can "defeat" password saving by having input fields not have type "password". I use the "autocorrect" and "autocapitalize" attributes (which don't work on all browsers of course) because I've had user feedback that capitalization and correction in authentication forms makes people nervous and confused. (It's mostly a problem with phones.) – Pointy Jul 02 '15 at 13:12
  • i am working on a project for banking system, my client has strictly demand to close these prompts, what should i do? Is my method safe? – Atif Jul 02 '15 at 13:12
  • @AtifFayaz: Does your method work on all browsers and versions? I think you just need to explain the reasons to your client and say that you have implemented a solution that works now, but make it clear that it is not future proof and is very depending on how browsers are implemented - this is out of your control – musefan Jul 02 '15 at 13:34

1 Answers1

2

Firefox 30 ignores autocomplete="off" for passwords, opting to prompt the user instead whether the password should be stored on the client. Note the following commentary from May 5, 2014:

  • The password manager always prompts if it wants to save a password. Passwords are not saved without permission from the user.
  • We are the third browser to implement this change, after IE and Chrome.

According to Mozilla developer documentation the form element attribute autocomplete prevents form data from being cached in older browsers.

<input type="text" name="foo" autocomplete="off" />

References: How do you disable browser Autocomplete on web form field / input tag?

Community
  • 1
  • 1
Praveen Kumar Purushothaman
  • 154,660
  • 22
  • 177
  • 226
  • Surely if you are going to copy an answer without adding anything to it then you should have just linked the question, or voted to close as dupe – musefan Jul 02 '15 at 13:10
  • @musefan I added this answer 4 mins ago **with a reference**. Politely, thanks! – Praveen Kumar Purushothaman Jul 02 '15 at 13:12
  • that means there is no solution for doing this? – Atif Jul 02 '15 at 13:16
  • @PraveenKumar: Yeah I can see the reference, doesn't make it ok to copy and answer word for word... you have added nothing of your own to it (expect the reference) so you should just link to it as a comment. OR write your own answer, and "quote" the original where appropriate. – musefan Jul 02 '15 at 13:29
  • @musefan I completely agree with you and I am being a dumbass with **this** answer. This cannot be explained any better. That's the only reason for this kinda plagiarism. – Praveen Kumar Purushothaman Jul 02 '15 at 13:31