131
rated 0 times
[
137]
[
6]
/ answers: 1 / hits: 20262
/ 12 Years ago, tue, april 17, 2012, 12:00:00
I'm trying to fill Webforms from a Webview in Android.
I've already found this piece of code here: Fill fields in webview automatically
String username = cristian;
webview.loadUrl(javascript:document.getElementById('username').value = '+username+';);
Unfortunatly I dont understand where I have to open the page I want to fill in.
setContentView(R.layout.web);
final WebView mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl(url);
String user=u;
String pwd=p;
mWebView.loadUrl(javascript:document.getElementById('username').value = '+user+';document.getElementById('password').value='+pwd+';);
When I try it this way, the site gets displayed but without any values in the forms.
Thanks in advance for helping
More From » android