I am attempting to eliminate the browser's 'Save Password' feature (my previous inquiry). To achieve this, I have simply inserted a new input field with type="password"
into the form. Here is the code snippet:
<form method="post" action="yoururl">
<input type="password" style="display:none"/><!-- Disabling "Save Password" -->
<input type="text" name="username" placeholder="username"/>
<input type="password" name="password" placeholder="password"/>
</form>
Please note: Modern browsers do not support using autocomplete=false
. Therefore, that approach will not be effective. Instead, I am following this method.
What seems to be the issue? When I hide the unnecessary input using display:none
, the saving password option still persists. However, if I hide it using visibility:hidden
, it functions as intended.
The visibility property occupies space on the page, which is something I want to avoid. How can I hide the unnecessary input without taking up space?
display:none
works but defeats the purpose of including the input.visibility:hidden
is not ideal because it occupies space on the page.
Is there an alternative solution for this situation?