Try display:none
<input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;" /> <input type="password" name="password_fake" id="password_fake" value="" style="display:none;" /> <input type="password" name="password" id="password" value="" />
You can also use jQuery
to solve this problem, I hope this helps you if not a request to put a comment here, good luck :)
Update:
It depends on the version of chrome, sometimes it will not work for new versions of chrome, so you have to try a lot of things to prevent this problem, try these code snippets as well and please leave a comment :)
Decision 2
$('form[autocomplete="off"] input, input[autocomplete="off"]').each(function () { var input = this; var name = $(input).attr('name'); var id = $(input).attr('id'); $(input).removeAttr('name'); $(input).removeAttr('id'); setTimeout(function () { $(input).attr('name', name); $(input).attr('id', id); }, 1); });
It removes the attributes "name" and "id" from the elements and assigns them back after 1 ms. Put it on the document to prepare.
Decision 3
<input type="text" name="email"> <input type="password" name="password" autocomplete="new-password">
Tested and works in Chrome 53
Decision 4
try autocomplete="false"
instead of autocomplete="off"
or nofill
source share