0

It seems like every other week I am needing to add to, extend, or come up with different methods to this issue. Ever since Google decided hey we don't want to recognize the "autocomplete" attribute anymore. My sanity has gone out the window.

I have a password field in a form, that a user needs to rekey their password to authorize the action taken. However because of that field, chrome decides it wants to prefill whatever wherever text field that comes before that with user credentials.

I have tried hidden inputs, either by type hidden of styled to be hidden, I have tried showing fields for a brief moment above the form and then dynamically styling them out. I have tried numerous things prior to that as well, and nothing works.

My problem overall is I can't simply enforce through scripting to clear the field either, as the fields in question could potentially be populated by my scripts from the front end or the backend, as theres no clean method of detecting what put what in the field.

So what is the solution? Anyone have anything good?

chris
  • 36,115
  • 52
  • 143
  • 252

1 Answers1

0

The way I combated this is this:

<form method="post" action="post.php" id="messageForm" autocomplete="off">

That autocomplete="off" did exactly what I wanted it to do.

EDIT: I'm just now seeing that you said the autocomplete attribute isn't working for you. Did you put it in the form tag at all? This works great for me, I have no issues with Chrome autocomplete anymore.

Treedot
  • 101
  • 1
  • 10