7

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.

Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134
Leo Seyha
  • 71
  • 1
  • 2
  • Try using `focus()` on an element that doesn't accept text input when the JavaScript detects that 'go' has been pressed. Credit to http://stackoverflow.com/questions/2890216/hide-keyboard-in-iphone-safari-webapp – Greg Nov 16 '11 at 09:31

1 Answers1

8

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

Gino
  • 1,834
  • 2
  • 19
  • 20