Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Highlighted
New Contributor
Posts: 2
Registered: ‎04-19-2012
My Device: Torch 9800, PlayBook 16GB
My Carrier: Manx Telecom
Accepted Solution

How to force numeric keyboard for PB

Good afternoon everyone.

Sorry that my first post is a question... I have a little problem with an app I've written for the PB in WebWorks.

A button press event calls a JS prompt box, and I'd like to default to the numeric keypad.  It seems that this should be simple in HTML5 (as described in http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Tip-for-invoking-Numeric-Keypad-... ), but I can't seem to get it working.

It may be that my HTML is ugly and consequently broken, for which I apologise!

TD class of "event", and id of "button2" are defined in the css.  The onclick event is defined in the .js file.  Icon code is written as:-

        <td class="event"><button type="button" input type="number" id="button2" onclick="clickVar()"/><img src="images/img1.png" alt="Enter number"></td>

 


It works fine, but I can't seem to force the numeric keyboard - I've tried both "number" and "tel" for the input type.

Many thanks for your time.

Developer
Posts: 62
Registered: ‎04-29-2010
My Device: N/A

Re: How to force numeric keyboard for PB

[ Edited ]

Well the input code should look like:

 

<input type="number" id="button2" onclick="clickVar()"/>

 

Not sure what you're trying to do there in your code but think you may be trying to do this:

 

<td class="event"><input type="number" id="button2" onclick="clickVar()"/><button type="button"><img src="images/img1.png" alt="Enter number"></button></td>

New Contributor
Posts: 2
Registered: ‎04-19-2012
My Device: Torch 9800, PlayBook 16GB
My Carrier: Manx Telecom

Re: How to force numeric keyboard for PB

Thanks so much for having a look at that, and your suggestion - I'll play around and see what I can fix!