Type of Soft Keyboard in Custom HTML Page

Is there a way to indicate which soft keyboard layout (I only need numbers) is displayed when a user enters an input text box on an HTML page?

I can change the HTML page and Javacode (I have an activity embedding a WebView). However, it should not affect other platforms if I change the HTML code (another browser / device should still correctly interpret the input field and show a soft keyboard, not just a keyboard with numbers)

+5
source share
3 answers

I have not tried this, but theoretically it should work:

HTML5 type <input>, . . Android, , Javascript, Android ( , , , Android - ), ( , ) type number.

+4

, , - . WebKit, . , , .

2.3.4, My Nexus S, type = number, .

+1

I also saw that adding 'pattern = "[0-9] *"' to your input tag. Try:

<input type="number" size="4" maxlength="4" pattern="[0-9]*" ></input>
+1
source

All Articles