Android xamarin forms WebView disable autocomplete
I have a xamarin form WebView, which uses source = "myinternalsite. Companysite. Com" to load web pages. The source has HTML input text fields in the HTML form
This is what is happening. Users enter content in the input field and submit. Then they return and start typing again, and then a drop-down menu appears in the input field, in which the last content is entered. (in Chrome browser, it is set to "enable automatic filling function, fill web forms with one click" and set to "save form entries" at the edge)
How can I disable auto filling of HTML forms in xamarin WebView?
Or must it be done in HTML
resolvent:
This depends on how you load the web page. If you do the following:
var browser = new WebView {
Source = "http://xamarin.com"
};
Then you are unlucky because you have no control over the HTML elements in the displayed page
However, if you build your own web pages in this way:
var browser = new WebView();
var htmlSource = new HtmlWebViewSource();
htmlSource.Html = @"<html><body>
<h1>Xamarin.Forms</h1>
<p>Welcome to WebView.</p>
</body></html>";
browser.source = htmlSource;
You can then use these properties to control autocomplete:
<input autocomplete="off"/>
or
<textarea autocomplete="off"/>