We are developing a regular asp.net website (no Textviews), for one of the text boxes I need the textbox to open a numeric keyboard by default, is there a way to achieve this?
Below code works perfectly for iPhone / iPad but does not default to numeric keyboard for Android.
<asp:TextBox runat="server" type="number" pattern="\d*" onKeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}" />
Adroid version : 2.2.1
EDIT :
When I use an HTML input box with type=”number” it works perfectly. I need a way to use asp.Net textbox and see the numeric keyboard.
Here is my solution:
Enjoy 🙂