Show iPad keyboard to choose, focus or always (jQuery)

I have a web application that uses jQuery to replace the RETURN key with TAB, so when I press the user button, the form is not submitted, and the cursor moves to the next text field.

This works in all browsers, but only 1/2 works on the iPad. The following box is highlighted on the iPad, but the keyboard is hidden. How can I keep the keyboard visible or make it somehow?

Here is my code (thanks http://thinksimply.com/blog/jquery-enter-tab ):

function checkForEnter (event) {
    if (event.keyCode == 13) {
          currentBoxNumber = textboxes.index(this);
        if (textboxes[currentBoxNumber + 1] != null) {
            nextBox = textboxes[currentBoxNumber + 1]
            nextBox.focus();
            nextBox.select();
            event.preventDefault();
            return false;
        }
    }
}

Drupal.behaviors.formFields = function(context) {   
    $('input[type="text"]').focus(function() { $(this).removeClass("idleField").addClass("focusField"); });
    $('input[type="text"]').blur(function() { $(this).removeClass("focusField").addClass("idleField"); });

    // replaces the enter/return key function with tab
    textboxes = $("input.form-text");
    if ($.browser.mozilla) {
       $(textboxes).keypress (checkForEnter);
    } else {
       $(textboxes).keydown (checkForEnter);
    }
};
+3
source share
1 answer

, , click, mouseup mousedown.

:

focus() Mobile Safari . () /.

+2

Source: https://habr.com/ru/post/1783104/


All Articles