Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Mobile Safari: Force keyboard open

This is an HTML / CSS / JS (jQuery) iPad app. I've got a button, that slides down an input form. I'd like to focus the user on the input, and then launch the keyboard.

This is what I'm working with, but doesn't work:

$('#myFormField').focus(); 

This does indeed focus the input, but fails to launch the keyboard. Is it just not possible (for security reasons or whatever)?

Is there a way to force or simulate a user tapping the input (or anything for that matter)?

like image 889
KrazyKen04 Avatar asked Jul 12 '10 09:07

KrazyKen04


People also ask

How do I force my iPhone to open the keyboard?

Go to Settings > Accessibility > Keyboards, tap Full Keyboard Access, then turn on Full Keyboard Access.

How do I make the Safari keyboard pop up?

Turn it on: On your Mac, choose Apple menu > System Preferences, click Accessibility , click Keyboard, click Viewer, then select Enable Accessibility Keyboard. You can also turn on the Accessibility Keyboard by clicking the Input menu in the menu bar, then choosing Show Keyboard Viewer.

Why isn't my keyboard popping up on my iPhone?

Restart iPhone Simply, restart your device and you might be surprised to see the keyboard back and working on your iPhone or iPad. Go to Settings > General > scroll down and tap on Shut Down. On the next screen, use the Slider to Shut Down iPhone. Wait for 30 seconds and Restart iPhone.


2 Answers

Maybe these links can help you:

  • http://4pcbr.com/topic/how_to_open_keyboard_on_ipad_with_js (not working anymore)

  • http://jgestures.codeplex.com

like image 60
Sylter Avatar answered Sep 20 '22 10:09

Sylter


Try this

Tested on Safari iPhone 7 & iPhone 6 Plus, Android 4.4

and it opened iOS virtual keyboard successfully when I touched the button.

condition

1) make a Button to trigger keypress event => $('.btn_abc')

2) make a text input tag, and set the ID to this element => $('#search_input')

$( document ).ready(function() {    var focusTextField = function(){     console.log("focusElement");   };    var onKeypressHandler = function(){     console.log("* * * keypress event handler")     $('#search_input').blur().focus();   };    var onClickHandler = function() {     $('.btn_abc').trigger('keypress');   };    $('#search_input').bind('focus', focusTextField);   $('.btn_abc').bind('click', onClickHandler);   $('.btn_abc').bind('keypress', onKeypressHandler);  }); 
like image 40
jamy Avatar answered Sep 17 '22 10:09

jamy