dot
dot

Reputation: 2833

iPhone keyboard in UIWebView does not go away

I have an UIWebView that loads a HTML form.

When I select a text field the keyboard appears.

When I type and hit "Go" the form is submitted and the next page loads, but the keyboard does not go away, it stays on the screen.

The only way to get rid of the keyboard is to press the 'done' button on the keyboard or press the HTML submit button in the form.

Is it possible to make the keyboard disappear after hitting the Go button?

Thanks!

Upvotes: 3

Views: 5663

Answers (1)

rpetrich
rpetrich

Reputation: 32316

You need to have the active input resign the focus as the form submits. The easiest way would be to call .blur() on all your inputs in your form's onsubmit event handler

<form onsubmit="document.getElementById('myInput').blur();">
    <input type="text" id="myInput"/>
</form>

Upvotes: 9

Related Questions