Non-Laravel Stuff

If you ever had a problem with Chrome auto-fill and this StackOverflow post did not help – maybe this will work for you.

I am adding solution here, since they locked that post in Stack Overflow.

Page will load your defined value, thus preventing Chrome auto-fill from loading.

Then, when user focus input field , JS will remove that defined value and browser will show placeholder with entry caret blinking at the beginning of input field – as expected by user.

I use onfocus instead of onclick, as onfocus works every time field is focused by user, also when tab is used.

Make sure your placeholder and value are different.
It seems Chrome compares these and if they are same, Chrome applies auto-fill.

As to fields with type=”password”, it seems it is not needed.
Possibly because if you disrupt autofill at email level, it gives up.
If that does not work, empty value seems to work here as well.


Of course this solution will not work for all.
I created it just for my particular need: password reset form, where Chrome was refilling form fields and user was confused, why he/she was not able to reset password, assuming these refills were a valid part of reset procedure.


Additionally, this is a workaround.
I wish Google employees stop counting their enormous salaries and spend more time righting their wrongs.
But that is just a dream – Google is too big to give a damn anymore.