I was struggling for a while on the html5 autocomplete feature of Chrome. I had a form like this
<form>
<input name='myname' type='email' autocomplete='on' />
<input type='submit' value='Submit!' onclick='transform_and_post_data();return false;'/>
</form>
When using Firefox and returning to this form autocomplete works fine. But not with Chrome (versions 26 to 30 at least). I finally found that autocomplete saving of a form is done only when calling the GET or POST default action of the form (here prevented by the return false). So I found a work around that fixes it in some situations :
<form method='post' action='myaction'>
<input name='myname' type='email' autocomplete='on' />
<input type='submit' value='Submit!' onclick='transform_data();'/>
</form>
This works well as long as I do not need to post my form data through an XhttpRequest. Does any one knows a trick to make Chrome autocomplete forms with XHRs?
Is it a known bug of Chrome? (as Firefox works as expected)
Note : autocomplete='on' should be useless because it is the default behaviour of an input
Chrome respects autocomplete=off only when there is at least one other input element in the form with any other autocomplete value. This will not work with password fields--those are handled very differently in Chrome. See https://code.google.com/p/chromium/issues/detail?id=468153 for more details.
This isn't a bug - autocomplete isn't supported by Chrome any more. It's a design decision by their developers and you should design for it rather than attempting to work around it.
Setting autocomplete=”chrome-off” was the most promising for us. However, there is a limitation in that it will work for a maximum of 5 input fields; any more than that and Chrome will ignore it for the subsequent input fields.
Please provide ID to your input variable
<form method='post' action='myaction'>
<input name='myname' type='email' id="myname" autocomplete='on' />
<input type='submit' value='Submit!' onclick='transform_data();'/>
</form>
Then it should work, without id it wont work
Chrome will only save the autocomplete information on submit. There are some workarounds detailed here: Trigger autocomplete without submitting a form
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With