3
jQueryを使用してRETURNキーをTABに置き換えるWebアプリケーションがあるので、ユーザーが押してもフォームが送信されずにカーソルが次のテキストフィールド。選択、フォーカス、または常に(jQuery)でiPadキーボードを表示
これはすべてのブラウザで機能しますが、iPadでは1/2しか動作しません。 iPadでは、次のフィールドは強調表示されますが、キーボードは隠されています。どのようにキーボードを見えるようにしたり、何らかの形で強制することができますか?私はそれがテキスト入力要素に触れるとclick
、mouseup
またはmousedown
をトリガするユーザーせずにキーボードを表示することはできません信じて
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);
}
};