8

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/

Kanarie
  • 183
  • 1
  • 2
  • 9
  • edited post and added some example code – Kanarie Jul 04 '12 at 12:07
  • How is the HTML linked with Android? Are you having troubles with the HTML input or with the Android EditText? – RvdK Jul 04 '12 at 12:58
  • I'm not sure what you mean. The Cordova-app shows a HTMLpage and if I enter text in the input/textarea, the androidkeyboard shows up with suggestions. I would like to know if I can switch the suggestions off in the HTML, the Android EditText or somewhere else. – Kanarie Jul 04 '12 at 13:13
  • @Kanarie: if you have a problem with the input and textarea then the main.xml is not relevant because you are not using that one? – RvdK Jul 04 '12 at 13:45
  • @PoweRoy: Thanks, I think you're right. I created a html-page and when I browse there, there's the same problem. – Kanarie Jul 04 '12 at 14:20
  • I'm beginning to think that it simply is not possible yet on Android? That would be a real bummer... – Kanarie Aug 07 '12 at 07:39
  • possible duplicate of [Android Webview (Phonegap): Disable Autocorrect, Autocapitalize and autocomplete doesn't work](http://stackoverflow.com/questions/7849443/android-webview-phonegap-disable-autocorrect-autocapitalize-and-autocomplete) – Alex K Oct 01 '12 at 06:43

3 Answers3

2

try android:inputType="textNoSuggestions" in you EditText

Mohsin Naeem
  • 12,542
  • 3
  • 39
  • 53
2

I Just discovered it!, it's so easy!, just put into the input: name="password" Just it!

  • 11
    Instead of posting 2 exactly the same answers on different questions, please flag one of the questions as a duplicate if you think that both questions are essentially the same. – Bart Sep 30 '12 at 13:34
  • 3
    @BenClayton Try to add too autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" – Rafa Gómez Casas Jun 11 '13 at 18:44
  • 1
    Nothing else was working for me, but this one is! I use Cordova with Ionic v1. – vargen_ Aug 21 '18 at 16:49
0

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)

Kanarie
  • 183
  • 1
  • 2
  • 9
  • 4
    It does indeed work for most devices, but for **Samsung devices** it does **not** work as they use their own keyboard which doesn't respect html attributes for autocomplete. :'( – mineralwasser Aug 23 '16 at 19:53