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.
<
Tested on Safari iPhone 7 & iPhone 6 Plus, Android 4.4
and it opened iOS virtual keyboard successfully when I touched the button.
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);
});