I have created a WebView and opened up a web page in it that contains a form. I need to fill that form programmatically (need to get some data form sqlite database and fill it).
how i can do that ? can anyone please help me out.
EDIT : the web page is a sign-up form and i do not own that web page.. i cannot add java script into that page.
I would use javascript in this situation.
Here is how. Make your webview javascript-enabled.
Java code in your webview activity
webview.loadUrl("javascript: fillUpForm(inputId,inputValue)");
javascript in your html file
function fillUpForm(id,value)
{
document.findElementById(id).value=value;
}
Frankly, I am no expert in javascript. But this should give you starting point.
Well, in your case,
I would try this
view.loadUrl("javascript:(function(){document.getElementById('trop').value='some value';})()");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With