Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide iPhone's keyboard using Javascript

Does anyone know how to hide iPhone's keyboard in Safari after user touch button "Go" instead of "Done"?

I need solution for Javascript and HTML5.

like image 287
Leo Seyha Avatar asked Nov 16 '11 09:11

Leo Seyha


People also ask

How do I force my Iphone to hide the keyboard?

To hide it, slide your finger down from above the text-entry box and the keyboard will start to disappear. Carry on until only the text-entry box is left. To make the keyboard reappear, tap the text-entry box and it will shoot right back up so text can be entered again.

How do you hide your keyboard?

Tap the back button on your Android. It's the left-pointing arrow button at the bottom of the screen, either at the bottom-left or bottom-right corner. The keyboard is now hidden.


1 Answers

With jQuery

You should unfocus the input from the button you click,

$("#button_id_clicked").click(function() {
    $("#search_input_id").blur(); // UNFOCUS THE INPUT                          
}); 

I use it on my web app

like image 126
Gino Avatar answered Nov 03 '22 06:11

Gino