How can I make the android keyboard appear when a user touches inside of a textbox? I am using phonegap build.
- 12 Posts
- 0 Reply Likes
Posted 9 years ago
- 12 Posts
- 0 Reply Likes
- 1911 Posts
- 199 Reply Likes
This should be the default behaviour for interacting with an input tag. What is the markup you're using?
(please escape the markup, so that it will be readable on get satisfaction)
(please escape the markup, so that it will be readable on get satisfaction)
- 12 Posts
- 0 Reply Likes
- 1911 Posts
- 199 Reply Likes
- 12 Posts
- 0 Reply Likes
- 1911 Posts
- 199 Reply Likes
There must be something else in the code of the page - can you try uploading an empty HTML page, only containing the input box (no script tags, no styles)?
Which device and OS version are you testing on?
Which device and OS version are you testing on?
- 25 Posts
- 0 Reply Likes
Is there a way to programmatically open the keypad?
I have a search view, and I want the search input field to have focus with the keyboard open when the user goes to the view, but setting the focus with Javascript only shows the cursor on the input and a touch on the field is required to open the keypad.
I have a search view, and I want the search input field to have focus with the keyboard open when the user goes to the view, but setting the focus with Javascript only shows the cursor on the input and a touch on the field is required to open the keypad.
- 1941 Posts
- 89 Reply Likes
Hello,
There is an article here for that issue however it requires a plugin, which at the moment PhoneGap Build does not support.
http://wiki.phonegap.com/w/page/27915...
Hardeep Shoker
There is an article here for that issue however it requires a plugin, which at the moment PhoneGap Build does not support.
http://wiki.phonegap.com/w/page/27915...
Hardeep Shoker
- 4 Posts
- 0 Reply Likes
Hardeep-
Regarding Kimmo Puputti's question: It seems like PhoneGap should show the soft keyboard automatically on a text field focus, no?
Regarding Kimmo Puputti's question: It seems like PhoneGap should show the soft keyboard automatically on a text field focus, no?
- 1911 Posts
- 199 Reply Likes
Yes, PhoneGap does this by default. Hardeep's link is only relevant if you want to display or hide the keyboard programmatically, for other purposes.
There is probably an issue with Kimmo's specific setup - either the device he's using, the OS, or some combination thereof.
There is probably an issue with Kimmo's specific setup - either the device he's using, the OS, or some combination thereof.
- 4 Posts
- 0 Reply Likes
Andrew- Thanks for the response.
You're correct that if a user taps a text field to focus it, PhoneGap automatically shows the keyboard.
The issue that is being seen is that if the text field is focused via JavaScript ( dom_node.focus() ), the keyboard is not automatically shown.
You're correct that if a user taps a text field to focus it, PhoneGap automatically shows the keyboard.
The issue that is being seen is that if the text field is focused via JavaScript ( dom_node.focus() ), the keyboard is not automatically shown.
- 1 Post
- 0 Reply Likes
I've just tested this and it does not seem to be the right info. See below:
function focusInputText() {
document.getElementById("txt").focus();
}
<input id="txt" type="text">
PhoneGap does show the keyboard regardless.
Can you please inform how you came to that conclusion?
Thanks.
function focusInputText() {
document.getElementById("txt").focus();
}
<input id="txt" type="text">
PhoneGap does show the keyboard regardless.
Can you please inform how you came to that conclusion?
Thanks.
- 4 Posts
- 0 Reply Likes
thyagoponzoni- Thanks for investigating. I've tried the following super basic index.html file and the keyboard consistently fails to show (on Android 2.2):
The PLACEHOLDER text disappears, indicating the field has focus, but the keyboard does not appear.
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="lib/phonegap/phonegap.js"></script>
<script type="text/javascript">
window.onload = function() {
document.getElementById("txt").focus();
};
</script>
</head>
<body>
<input id="txt" type="text" placeholder="PLACEHOLDER">
</body>
</html>
The PLACEHOLDER text disappears, indicating the field has focus, but the keyboard does not appear.
- 1911 Posts
- 199 Reply Likes
Does this work as expected in the Android browser, outside of PhoneGap?
- 4 Posts
- 0 Reply Likes
Behaves the same (erroneous) way for me in the Android browser: http://tylercharlesworth.com/public/2...
- 1911 Posts
- 199 Reply Likes
This is probably an Android issue then, not one that PhoneGap has any direct control over.
I didn't see an existing issue here:
http://code.google.com/p/android/issu...
so you may want to file a new one.
I didn't see an existing issue here:
http://code.google.com/p/android/issu...
so you may want to file a new one.
Related Categories
-
PhoneGap Framework
- 2926 Conversations
- 61 Followers
-
PhoneGap Build
- 15111 Conversations
- 275 Followers




