- Add
autocomplete="off"
onto<form>
element; - Add hidden
<input>
withautocomplete="false"
as a first children element of the form.
<form autocomplete="off" method="post" action="">
<input autocomplete="false" name="hidden" type="text" style="display:none;">
...
This formation is going to prevent Chrome and Firefox to offer autofill and autocomplete for all input fields inside the form.
If the requirement is to prevent form auto-filling, the following solutions are effective for me. ( chrome : 126.0.6478.127, Firefox: 127.0.2)
For input type=‘text’, autocomplete="off" works,
For input type=‘password’, autocomplete="new-password" works.
But I want to disable password suggestions, the above solutions do not work. In the end, Instead of using a regular password input field, I used a text input field. When entering, it converts plaintext into ••• while storing the actual input .