Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable autocomplete on Android

I have an app built in HTML5 and wrapped in PhoneGap ..

I want to disable Android's autocomplete (Of the keyboard)

when starting the application,

how can I do this?

Thanks in advance

My PhoneGap Manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.MyApp.XXX"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="16" />
<supports-screens 
    android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:resizeable="true" 
    android:anyDensity="true" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.MyApp.XXX.MainActivity"
            android:label="@string/app_name"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" >

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
like image 220
Hodaya Shalom Avatar asked Dec 31 '12 08:12

Hodaya Shalom


2 Answers

Try this :

<input type="text" id="myText" name="myText" autocomplete='off'/>

Or

someFormElm.setAttribute( "autocomplete", "off" );
like image 83
Pratik Sharma Avatar answered Sep 30 '22 18:09

Pratik Sharma


'oninput' event in the input, ran the following function:

function RefreshAutoComplete(elm) {
    elm.keyup();
    elm.focus();
}

I run the auto complete manually, and it works

Thank you all for the help

like image 41
Hodaya Shalom Avatar answered Sep 30 '22 18:09

Hodaya Shalom