I remember seeing a way to have an such that the browser will not prompt the user to save the password. But I
The only way I can get firefox, edge, and Internet explorer to turn off autocomplete is to add autocomplete="false" in my form statement like:
<form action="postingpage.php" autocomplete="false" method="post">
and I have to add the autocomplete="off" to my form input and change the type to text Like:
<input type="text" autocomplete="off">
It seems that this html code needs to be standardized with the browsers. the form type = password should be revised so that it overrides browser settings. The only issue I have is that I lost my input masking. But on the bright side the annoying "this site is not secure" is not showing up in firefox.
for me, its not a big deal since the user is already authenticated and its my change user name and password portion of it
Read also this answer where he is using this easy solution that works everywhere (see also the fix for Safari mobile):
<input type="password" readonly onfocus="this.removeAttribute('readonly');"/>
Try using autocomplete="off"
. Not sure if every browser supports it, though. MSDN docs here.
EDIT: Note: most browsers have dropped support for this attribute. See Is autocomplete="off" compatible with all modern browsers?
This is arguably something that should be left up to the user rather than the web site designer.
I tried the following and it seems that works to any browser:
<input id="passfld" type="text" autocomplete="off" />
<script type="text/javascript">
$(function(){
var passElem = $("input#passfld");
passElem.focus(function() {
passElem.prop("type", "password");
});
});
</script>
This way is much more safer than using timeout techniques, because it guaranties that the input field will yield to password when the user focuses it.
In the case of most major browsers, having an input outside of and not connected to any forms whatsoever tricks the browser into thinking there was no submission. In this case, you would have to use pure JS validation for your login and encryption of your passwords would be necessary as well.
Before:
<form action="..."><input type="password"/></form>
After:
<input type="password"/>
I've found the following works on Firefox and Chrome.
<form ... > <!-- more stuff -->
<input name="person" type="text" size=30 value="">
<input name="mypswd" type="password" size=6 value="" autocomplete="off">
<input name="userid" type="text" value="security" style="display:none">
<input name="passwd" type="password" value="faker" style="display:none">
<!-- more stuff --> </form>
All of these are within the forms section. "person" and "mypswd" are what you want, but the browser will save "userid" and "passwd" once, and never again since they don't change. You could eliminate the "person" field if you don't really need it. In that case, all you want is the "mypswd" field, which could change in some way known to the user of your web-page.