问题描述
我正在使用Cordova(1.9.0),html5,javascript开发Android应用程式(2.3.3)。
I'm working on an Android app (2.3.3) using Cordova (1.9.0), html5, javascript.
这是一种语言训练工具,用户在textareas或inputfields中输入他们的答案,我不希望他们看到建议。
It's a language training tool so when users type their answers in textareas or inputfields, I don't want them to see suggestions.
我在textarea和input标签中尝试了autocomplete =off好像在形式标签,但都不工作。有谁知道如何关闭这些建议?
I've tried autocomplete="off" in the textarea and input tag as well as in the form tag, but neither work. Does anyone know how to turn these suggestions off?
我的test-html如下所示:
my test-html looks like this:
<div><b>With form:</b>
<form autocomplete="off">
<p>Wie <input size="5" value="b" autocorrect="off" autocapitalize="off" autocomplete="off" spellcheck="false"> jij?</p>
<textarea spellcheck="false" autocorrect="off" autocapitalize="off" autocomplete="off"></textarea>
</form>
</div>
<div><b>No form:</b>
<p>Jan, ik <input size="5" value="b" autocorrect="off" autocapitalize="off" autocomplete="off" spellcheck="false"> Jan.</p>
<textarea spellcheck="false" autocorrect="off" autocapitalize="off" autocomplete="off"></textarea>
</div>
更新:
我创建了一个html-testpage并使用Android手机浏览,仍然遇到相同的自动完成/建议问题。所以也许这不是一个Cordova应用程序问题,但Android浏览器问题?
查看(在Android手机上)
推荐答案
在cordova应用程序中,至少Android 4.4,html5属性autocomplete =off如上所述没有任何效果。
然而在Android 6 autocomplete =关闭工作!
Up until at least Android 4.4 in cordova apps, the html5 attribute autocomplete="off" as described above does not have any effect.However on Android 6 the autocomplete="off" does work!
这取决于Android版本,而不是html。
So it depends on the Android version, not the html.
(这是一个cordova 5.1.1 android平台,万一有人想知道)
(This is a cordova 5.1.1 android platform, in case anyone is wondering)
这篇关于在Android Cordova应用程序中关闭textarea和inputfields的自动完成功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!