I created 2 login pages of same domain.
I put the form name different for 2 forms
I was encountered this issue for a long time. Firefox was kept input values even page reload. Setting autocomplete
attribute to off
did not solve.
Form caching is a really useful mechanism for the user experience. But, in the small percentage of use-cases like translating values of textboxes or texareas to other language, these gave me headache.
To resolve this, just simply reset the form after page was loaded as
$('form').trigger("reset");
thanks to the idea of albert.garipov, i made a solution that mimics the functionality of the type password. this doesn't show the password on input
<input type="text" id="password" onkeyup="OnChangePassword()">
function OnChangePassword()
{
if ($("#password").val() == "") {
$("#password").attr('type', 'text');
}
if ($("#password").val() != "") {
$("#password").attr('type', 'password');
}
}
This is the cleanest solution I have found to keep Firefox from auto completing.
<!-- The text and password here are to prevent FF from auto filling my login credentials because it ignores autocomplete="off"-->
<input type="text" style="display:none">
<input type="password" style="display:none">
Add this code snip-it above your input of type password.
As far as I can tell Firefox is looking for an input of type Password, and filling in the password and then adding the username to the input of type text above it. Without a name or an id the inputs don't get added to the post, but this is still a hack.
Use autocomplete="off" tag at the end of your input tag:
For ex.
<input type="text" name="username" autocomplete="off" />
Add autocomplete="off" to your form tag, as documented in the Mozilla document
Check the following link for more information
How to Turn Off the Autocompletion Feature