Reputation: 289
Inside Android's webview, a from containing a textarea is processed by javascript. The problem: After submitting/processing the form, the Keyboard does not disappear, unless the user clicks outside.
I would like to make the keyboard disappear, right after form submission. How can this be achieved?
<form>
<textarea>Hi there...</textarea>
</form>
<script>
$("form").submit(function(){
processForm();
// I tried .blur() and .focusout(), which make the textarea loose focus,
// but the keyboard still does not hide...
// $("textarea").blur();
// $("textare").focusout();
return false;
})
</script>
Upvotes: 1
Views: 1630
Reputation: 430
$("form").reset();
Resetting the form should cause the keyboard to hide. Alternatively, you could try.
$('input').blur();
Upvotes: 1