Reputation: 1
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>
Upvotes: 0
Views: 1062
Reputation: 11
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');
});
}
Upvotes: 0
Reputation: 102
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>
Upvotes: 1
Reputation: 521
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>
Upvotes: 0
Reputation: 61
Please try:
WebView.getSettings().setSavePassword(false);
WebView.clearFormData();
Upvotes: 0