关闭 Android Cordova-app 中 textarea 和 inputfield 的自动完成 [英] Turning off auto-complete for textarea and inputfields in Android Cordova-app
问题描述
我正在使用 Cordova (1.9.0)、html5、javascript 开发 Android 应用程序 (2.3.3).
这是一种语言培训工具,因此当用户在文本区域或输入字段中输入答案时,我不希望他们看到建议.
我已经在 textarea 和 input 标签以及在 form 标签中尝试过 autocomplete="off",但都不起作用.有谁知道如何关闭这些建议?
我的 test-html 如下所示:
<div><b>带形式:</b><表单自动完成=关闭"><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></表单>
<div><b>无格式:</b><p>Jan, ik <input size="5" value="b" autocorrect="off" autocapitalize="off" autocomplete="off" spellcheck="false">一月</p><textarea spellcheck="false" autocorrect="off" autocapitalize="off" autocomplete="off"></textarea>
更新:我创建了一个 html-testpage 并使用 Android 手机在那里浏览,仍然遇到相同的自动完成/建议问题.所以也许这不是 Cordova 应用程序的问题,而是 Android 浏览器的问题?看一看(在 Android 手机上)http://jsfiddle.net/f3AJq/
至少在cordova 应用程序中的Android 4.4 之前,如上所述的html5 属性autocomplete="off" 没有任何影响.然而,在 Android 6 上 autocomplete="off" 确实有效!
所以这取决于 Android 版本,而不是 html.
(这是一个cordova 5.1.1 android平台,以防万一有人想知道)
I'm working on an Android app (2.3.3) using Cordova (1.9.0), html5, javascript.
It's a language training tool so when users type their answers in textareas or inputfields, I don't want them to see suggestions.
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?
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>
Update: I created a html-testpage and browsed there using an Android-phone, still experiencing the same autocompletion/suggestion-issue. So perhaps this is not a Cordova-app issue, but an Android browser issue? Take a look (on an Android phone) http://jsfiddle.net/f3AJq/
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!
So it depends on the Android version, not the html.
(This is a cordova 5.1.1 android platform, in case anyone is wondering)
这篇关于关闭 Android Cordova-app 中 textarea 和 inputfield 的自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!