If you have a UIWebView, and load a web page with a form on it, can you programmatically populate that form? Either with objective-c or javascript, or something else?
+1
A:
You can execute javascript with the stringByEvaluatingJavaScriptFromString: method on the UIWebView. This will let you use document.getElementById()
etc. to locate and manipulate elements on the page.
Mike Weller
2010-07-16 10:01:34
Sure, I had a vague idea that was possible, but do you know how to fill in form elements with JS? In my case, it's just a few plain text fields.
cannyboy
2010-07-16 10:06:58
+3
A:
Code sample:
[webView stringByEvaluatingJavaScriptFromString:@"document.myForm.myText.value='text from Obj-C';"];
You can, basically, execute any JavaScript on your web view...
Michael Kessler
2010-07-16 10:04:32