iphone – Getting data from uiwebview textfield

iphone – Getting data from uiwebview textfield

You can use [UIWebView stringByEvaluatingJavascriptFromString:] method and get the values by executing the javascript.

Example:
If your html is:


  
      
  


Following code can get you the value of the text field:

   NSString* value = [webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('myId').value"];

posted on 2011-06-24 13:50  禚来强  阅读(332)  评论(0编辑  收藏  举报

导航