I am looking for a starting point on a project that needs to display a UIWebView on an iPad. THe catch is that the HTML will be generated by the pad and displayed in the UIWebView, and will contain many input controls.
What is needed is a way to grab the contents of these controls after the user has completed entry similar to how I would do it on a server. I need to grab this entered data on the iPad without an actual submit.
Does anyone know the starting point for this type of interaction?
Within the previously posted article it also mentioned the UIWebViewDelegate method,
This gets invoked on the delegate before a link is followed. I haven't tried it, but this method might be invoked when submitting the form. Use a GET method. Easier than having to loop out of the app and back.
Here's a way to do it:
Example URL could be: myapp://value_of_field1/value_of_field2/...
See the linked tutorial on how to register a custom scheme and how to retrieve the data in Obj-C.
It can be done in simple way.. we know HTTP request contains -
we can check header field value for Conent-type if it is x-www-form-urlencoded then form field values are sending thru them as key=value pairs
then we can catch therse paires in webView:shouldStartLoadWithRequest:navigationType: - in request parameter as
[request HTTPBody], similarly we can get method [HTTPMethod]..etc
if it is simply GET method then all pairs will be in request itself.
:) hope it helps
You can do this by implementing the UIWebViewDelegate delegate's shouldStartLoadWithRequest method:
It works fine with a post.