Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPad Safari - Make keyboard disappear

In iPad Safari browser, when I change focus from a textbox to a dropdown, the keyboard still remains... Is there some way (maybe with Javascript) I can hide the keyboard when user blurs from the textbox?

Indirectly speaking, I am looking for a equivalent of (but in Mobile Safari)

[tempTextField resignFirstResponder];  
like image 936
copenndthagen Avatar asked May 09 '11 13:05

copenndthagen


People also ask

How do I make the keyboard disappear on my iPad?

To automatically close the keyboard on iPad devices, click on the “Hide Keyboard” button (circled below). To hide the keyboard, use the Press Key method with the HIDE_KEYBOARD Key value. Click here for more information on the press key command.

How do I make the floating keyboard disappear?

Here's how to turn off the floating keyboard: To switch back to the regular keyboard, grab the bar at the bottom of the floating keyboard and drag it to the bottom center of your screen. Another method is to perform a reverse pinch gesture from the center of the iPad floating keyboard.


2 Answers

I found the solution for this at http://uihacker.blogspot.com/2011/10/javascript-hide-ios-soft-keyboard.html. Essentially, just do this (it worked for me):

var hideKeyboard = function() {     document.activeElement.blur();     $("input").blur(); }; 
like image 136
rdoggett Avatar answered Sep 19 '22 14:09

rdoggett


I had iPad with iOS 5.0.1 not hiding the keyboard after successful login on my site. I solved by simply executing the javascript command

document.activeElement.blur(); 

after successful login and now the keyboard is correctly hidden :-)

like image 20
lucaferrario Avatar answered Sep 19 '22 14:09

lucaferrario