I'm trying to get access to the mobile keyboard in a cordova app so that while the user is signing up, they can just jump to the next input on the keyboard. For example, on iOS native apps, you have access to change the "return" button to "next" or "go."
I've looked at the Ionic-plugin-keyboard but as far as I can see it doesn't allow you to do what I'm trying to do. Is there a way I can change those buttons with js/is there another plugin I can do that with?
Here are some potential resources for keyboard control:
link 1
link 2
link 3
In summary: On most devices it show a "next" button when adding the attribute tabindex to each input, incrementing in order. Otherwise it is generally suggested to set an input as the browser's default focus, or to detect when the user clicks "ok" and move the focus after that event (key code for "ok"/"enter" is 13).
Related
is there any way to set focus on the input field without showing keyboard on a device? The code is shared across the website and the mobile device. I just want to acquire situation when on a website I got "focus" on the input element as well as on device but without displaying a keyboard on the device. I tried:
document.getElementById("myInput").focus();
but doesn't work.
Why do you want to focus an input field if you don't want to write in it? Otherwise you can check with
var isMobile = Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
if the user agent is mobil before you take the focus.
It's a normal behavior of device.
You can use some cordova plugin (like this cordova-plugin-keyboard) to hide the keyboard.
Don't forget to check out if the user agent is from a mobile device
Anyway, it's the behavior of device, hide the keyboard will make your application act different from the others
I'm developing a game which needs to accept keyboard input anywhere over an HTML div (so, not in a conventional HTML text/area input).
I've added a key press handler to a DOM element, which is seeing the key events, but whenever I press a key, Firefox (58.0.2 currently) also opens a "find in page" bar at the bottom of the window. (It's similar to the one which opens if you do CMD-F, but without the Highlight All, Match Case, Whole Words options; but it does have results eg "2 of 2 matches"). If I don't type anything for a few seconds, it goes away again - but if I type a second character, it has grabbed the focus and my key press handler never sees any further events.
Is there a way of programmatically disabling this feature? I've tried setting the event not to propagate (and also key up/down events!), but it had no effect on this.
(This feature can be turned off by the user, by opening Preferences and unchecking "Search for text when I start typing", but I really don't want to have to write a series of tutorial screens guiding users through doing this themselves before they can play the game.)
I have been working on this specific requirement for more than 2 months now. But I haven't found a solution yet to disable the native keyboard when an input field is focused in a webview. I am building an app which has a built in keypad(essentially a view) and I want this to be displayed instead of the native keyboard.
What I've tried so far:
Add javascript eventListener for click events to display my keypad
using JavscriptInterface.(Works)
Set the webview focusable:false and
its parent's descendantFocusability to blocksDescendants (This works
but doesn't display the cursor on the input field)
Hiding the native
keyboard on resize event of javascript using loadUrl method.(Works
but the native keyboard is displayed momentarily before hiding the
keyboard)
Listening to the OnGlobalLayoutChange event to check if
the keyboard has been added. (Works but the result is same as
in the case above with a little improve in performance)
Force stop the IME service. (Works but the app has to be a system
app to force stop packages and the keyboard service has to be started
whenever the app goes to background.
Is there a way in which I can make this work?
You should set the windowSoftInputMode to stateAlwaysHidden for the Activity containing the web view. This should keep the onscreen keyboard hidden for the entirety of that Activity.
I have a page that is displayed in an UIWebView on an iPad app. The page has an input field, and when the user taps on it, the virtual keyboard popups up.
Currently, the keyboard has the blue 'Go' button. I would like to change the button text from 'Go' to 'Done' and I want to grey-out/disable the button until the user types in at least 1 char.
Is this possible with Javascript/jQuery mobile? I don't have access to the app.
Thanks.
I don't think this is possible. Bu you can change some functionality of the keyboard in html.
Make the button submit your form
Make another keyboard displayed
More features should not be available without access to the app. Instead of greying out the button, you can validate the form before submitting it with jQuery.
I'm trying to build an application where if the user activates a page, a focus event will occur and focus into a text field. I was half-heartedly expecting that when I called .focus() on in the input box, Windows 8 would pop-up the on-screen keyboard. This in not the case.
Does anyone know of a way to get the Windows 8 on-screen keyboard to come up when the text field is focused via javascript.
If the user "taps" into the textfield, the focus event does fire and the keyboard comes up.
I've tried binding to touchstart, 'touchend, click and focus, but all of these do not seem to activate the on-screen keyboard.
This application will run strictly on Windows 8, so there is no need to make it so that other platforms that do not have built-in on-screen keyboards work properly.
You can't. Only user actions can open the on-screen keyboard. This is by design. See here.