&LT;输入自动完成'对'&GT =;不与Chrome浏览器。它是一个错误吗? [英] <input autocomplete='on'> does not work with Chrome. Is it a bug?
问题描述
我挣扎的Chrome的HTML5的自动完成功能一段时间。我有这样的形式
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>
在使用Firefox并返回到这种形式的自动完成工作正常。但不能与浏览器(版本26至30至少)。我终于找到调用形式GET或POST默认操作,当一个表单的自动完成该节能只是做(这里美元的回报虚假pvented p $)。所以,我发现周围的工作,修复它在某些情况下:
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>
这工作得很好,只要我不需要通过Xhtt prequest发布我的表单数据。没有任何一个知道一招让Chrome自动完成的表格与XHR时?
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?
它是浏览器的一个已知的bug? (火狐按预期工作)
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将仅保存提交自动完成信息。这里有详细的一些解决方法:<一href=\"http://stackoverflow.com/questions/15462991/trigger-autocomplete-without-submitting-a-form\">Trigger自动完成而无需提交表单
Chrome will only save the autocomplete information on submit. There are some workarounds detailed here: Trigger autocomplete without submitting a form
这篇关于&LT;输入自动完成'对'&GT =;不与Chrome浏览器。它是一个错误吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!