0

I have a webiview in my android Activity. In that webview i am uploading a native html page. the HTML page contains input text field. I am trying to use autocomplete-off to make Off Suggestions. But Autocomplete -off not working in android .some suggestions are still there when i try to input some text.

Code i am trying is given below

<tr>
    <td style="position:absolute; top:5%;height:35px;width:100%;" >
        <input type="text" id="userName" placeholder = "User Name" autocomplete ="off" >
    </td>
</tr>
Manuel
  • 9,453
  • 5
  • 39
  • 58

4 Answers4

0

Please try:

WebView.getSettings().setSavePassword(false);
WebView.clearFormData();
Boris Knez
  • 84
  • 2
  • Sir, I Think Your Code Will Enable autoComplete- Off Only On the PassWord Field , Not Username Field. I Have Many Fields In My HTML Page. – user2753237 Jul 17 '14 at 10:05
0

I got you if you load HTML native page which you already created then open html page and change type of it it may be completed from java-Script. just remove it.

and if possible just post your android code here so I can take a look at it and tell you that if there is any error in android code.

<form name="form1" id="form1" method="post" autocomplete="off" action="........">

   Name: <input type="text" name="text1" /><br/>
   Address: <input type="text" name="text2" /><br/>
   Phone: <input type="text" name="text3" /><br/>
   Password: <input type="password" name="password" /><br/>
 <input type="Submit" name="Submit" value="Submit" />

</form>
Samarth Sevak
  • 521
  • 4
  • 15
0

your input element doesn't have the name attribute. thats why its not working.

<tr>
    <td style="position:absolute; top:5%;height:35px;width:100%;" >
        <input type="text" name="textbox1" id="userName" placeholder = "User Name" autocomplete ="off" >
    </td>
</tr>
Davy Quyo
  • 90
  • 6
0

Chrome does not support autocomplete="off" at the form level for some input fields.

There are 2 solutions to do so:

  • In your form, if only two or three fields ignore autocomplete="off", then use the field name itself as the autocomplete value. i.e. autocomplete=<input field name>

    <form:input type="text" id="name" path="name" autocomplete="name"/>
    
  • Instead of defining field name manually for each field, use a script for all text typed input at the loading of the page or after.

    if ($.browser.chrome) { 
        $(document).on('focus click tap', 'input', function() {
            $(this).attr("autocomplete", 'block');
        });
    } else {
        $(document).on('focus click tap', 'input', function() {
            $(this).attr("autocomplete", 'off');
        });
    }
    
Thomas F
  • 1,399
  • 2
  • 23
  • 23