Reputation: 2027
I have a UIWebView
in my app that parses HTML from a server and presents it. My challenge is that this HTML has a checklist in it, and I would like to capture what the user checks and unchecks the next time I load the same HTML.
Is there anyway to capture the click on the checkbox? Any ideas on how to do it?
Thanks in advance.
Upvotes: 4
Views: 190
Reputation: 10251
It can be done with the help of java script. It involves multiple steps
CheckboxStateChange
'.myevent://checkbox?id:value
shouldStartLoadWithRequest
method. You can check url scheme from the request object passed. If it is "myevent" you can parse the URL string to store the appropriate value. Upvotes: 1
Reputation: 653
if you can change html page - you can put javaScript callBack on chack change, and handle it in
- (BOOL)webView:(CustomWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
return YES;
}
Upvotes: 0