So right now I have a ViewController with UIWebView and a button. When the button is clicked it allows the user to email whatever I specify. For this occasion, there is going to be a textarea box (at a certain URL) inside the UIWebView. I want to be able to grab that text inside the textarea box and name it txtNotes, so I can use the following code to send the text inside the textarea via Apple’s email interface:
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"My TextArea"];
NSString *emailBody = self->txtNotes.text;
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];
So how would I grab the text from inside the textarea and name it as an object “txtNotes” in Xcode. Please also include code examples!
Thanks!
your HTML should include an id for the textarea for example
then you can perform this handy JS to Objective-C call to snatch the textarea.