How to read text value from UIWebview

by Deepak Dhakal 3. April 2012 10:41

Use [UIWebView stringByEvaluatingJavascriptFromString:] method and get the values by executing the javascript.

Example: If your html is:

<input id="myId" type="text" value="TextValue"/>

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

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



Powered by BlogEngine.NET
Original Design by Laptop Geek, Adapted by onesoft