0

i got a webview and i would like to capture an input from a webview HTML form. i have tried but i cant can some one help me please

this is my webview code

        // Init Web View
    UIWebView *webView;
    webView = [[UIWebView alloc] initWithFrame:boundsRect];
    webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    webView.scalesPageToFit = YES;
    webView.contentMode = UIViewContentModeCenter;
    webView.multipleTouchEnabled = NO;
    webView.userInteractionEnabled = YES;
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
    [self addSubview:webView];
    [webView release];
    return self;

To get value from webView, i used below code.

NSString* value = [webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('text').value"]‌​; 
NSLog(@"got: %@",value); 
santhu
  • 4,796
  • 1
  • 21
  • 29

1 Answers1

0

You could look into how phonegap http://phonegap.com/ solves this.

Harper04
  • 355
  • 2
  • 10