• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps To popup Numeric Keypad instead of Default Keypad | HTML code

shibdutta

Lurker
Hi

I have an HTML/JSP page which is supposed to run on Android phone.
Theres an Amount field, clicking on should pop up the Numeric Keypad
instead of Default keypad.


I am not able to find the code(HTML code) which should by-default bring the
numeric keypad.

I tried
<input android:inputType="phone" name="amount" value="1.00"
maxlength="9" class="formField"/>

it does not work..

please help
 
Welcome to the forum! :D

I presume you mean XML and not HTML? It's not very difficult.

Androidblogger describes that:
I found that a numeric editText ( or a textView) is done with this XML tag:
android:numeric="decimal"
Then I found that limiting the number of character is also very simple :
android:maxLength="10"
and that's all !
Also from Lost Droid:
I recently spent some time trying to figure out how get the Soft Keyboard to default to numeric input when I only required numbers entering. It
 
Thank you for your reply.

actually i meant HTML. So I have a webpage that has an Amount field in it. What i am looking for is that, when a user clicks on the text box, the numeric keypad should come up instead of default keypad.

I think your solution is for Android Application not for Web Pages which will be viewed on an Andriod Browser.


Regards
Shib
 
Oh I see, I misunderstood you then. I don't think there's any way to specify what you're looking for. :(

I mean, you can apply (script-based) data-entry limitations to your web page, but I don't think you can have the web page tell the client what kind of keyboard layout should be used. I'm sure CSS can't help you there, and I doubt if even HTML5 has a hook for that (and even if it did, I don't think the Android browser would be able to handle it).

The web is too old to know about virtual keyboards! :rolleyes:
 
ya, Web is not yet smart enough. :)

But i have done similar kind of thing for iPhone browser, by changing the Type of the field to type="number" (instead of "text"). So just by changing the Type of the TAG iPhone browser is able to recognise that it needs to display the Numeric keypad.

I was looking for something similar for Android :confused:. i believe Android is smart enough :eek:

Regards
Shib
 
I am looking for a solution for this challenge as well. Was able to do this for iPhone as mentioned above, but can't find anything on how to do this for Android.

Thanks for your help!
 
Back
Top Bottom