0

I have a UIWebView and when I have the keyboard up after entering in data, I want to be able to programmatically dismiss the keyboard, and hit the return key to load the next page. Is there anyway to do this?

Some Ideas: • Faking a tap on the Done Button • Sending a Carriage return via JavaScript

I have tried these but haven't been successful.

Matthew Knippen
  • 1,048
  • 9
  • 22

2 Answers2

2

Maybe you can use the [UIWebView stringByEvaluatingJavaScriptFromString] method to achieve it.

You can use the above method to exec a javascript, the script can be a submit form command. Here is some example:

NSString js = @"document.forms[0].submit()";
[self.webview stringByEvaluatingJavaScriptFromString:js];

Hope it helps.

tangqiaoboy
  • 1,476
  • 1
  • 15
  • 32
0

Have you tried the usual trick for hiding a keyboard?

You could try resignFirstResponder on the webview.

Community
  • 1
  • 1
Robert
  • 37,670
  • 37
  • 171
  • 213