I tried autocomplete ="off",oncopy="return false" onpaste="return false" but nothing work. I know it's a browser property but i need to do this clear website audit. i seen this kind of validation on payment gateway.
Despite it is not a Joomla question, it is still could be a relevant question in many area in Joomla Forms too and can be applied in Joomla, so I try to give a useful working solution (which I've found among a lot of nonworking and old solutions).
So the login form: (should be renamed according to your needs)
<form id="login-form"> <input class="form-control" name="username" placeholder="Username" type="text"> <input class="form-control password" name="password" placeholder="Password" type="text"> <button class="btn btn-lg btn-primary btn-block" name="demo-submit" value="Login" type="Submit">Login</button> </form>
And the jQuery script:
I tried this and it works even in Chrome where most of the times this autocomplete avoiding solutions fail. I did not try it on all browsers but the author claims it works on all browsers. The source with all of the info about this is here: https://github.com/terrylinooo/jquery.disableAutoFill
I hope this can help.
UPDATE - CUSTOMIZED SOLUTION FOR JOOMLA ADMIN LOGIN
Now, the above code works on many forms but not on Joomla admin login. I knew that I will have to take my time to customize the solution on this question to make it a Joomla question. So here is how to disable autofill/autocomplete on the Joomla Admin Login page:
it's relatively simple at the end.
I worked on the template: administrator/modules/mod_login/tmpl/default.php
(create a backup copy of this file to somewhere before edit that, then if you screw up something you can just place back that original file in place) Or, actually the right way is to create a template override of this module default.php file in the template manager of the admin.
1. On the top of the file after the closing php tag ( ?> ) paste the jquery import, just this code:
2. In the username and password input fields, add an attribute (autocomplete="off") (it may sound stupid but it should be there)
3. At the password input field change the type attribute to text ( type= "text" )
And that's it, it worked for me without a problem and I could signed in to my admin without problem, autofill was not ignited in the browser (I tried this on Chrome and on Firefox). I hope that it will work for you too and you can confirm this for me at your side. (it still could be simplified a lot, but at least it works now).
And just showing the result visually:
Firefox - Autocomplete is not ignited and the Joomla authentication works too. It's the same in Chrome.