1

I ahve a form to let people upload files. Here is the code below. Of course I oversimplified it and removed divs, labels, submit button, uneeded structural and layout code, etc.

<form id="uploadForm" action="" method="post" enctype="multipart/form-data">
<input required type="text" id="name" name="name"  />
<input required type="file" name="file" id="file" />
<input required type="password" name="password" id="password"  />
</form>

Each time I submit the form, Firefox and chrome, among others, systematically ask me if I want to remember this login/password for future use.

The problem is that this form has nothing to do with login. The name field is a file name, and the file may be password-protected (it has to be decrypted on the server), hance the password field. So, it's totally useless and even quite annoying when the browser asks me if I want to remember something.

IN the code above, I tried to use autocomplete=off, it doesn't change anything. Some other posts recommand using autocomplete=anything_else_than_off, but it doesn't work either. After a few more search, it seems that autocomplete is in fact now totally ignored by most recent browsers, including IE11.

How can I prevent the browser form asking "would you like to save ..." in such a case, when the form has nothing to do with login ? If possible, a solution compatible with firefox, chrome, safari, edge and IE11.

Thank you for your answers

QuentinC
  • 7,473
  • 3
  • 16
  • 28

1 Answers1

0

It should work if you set autocomplete="new-password" on the password field

Yoann N
  • 41
  • 3