Cordova and html to force numpad input on mobile phone, even if input type = "text"

I know that I can use type = "number" to display the number bar, but the problem is that I want to reformat the input according to the entered number into a string.

So, I want to have a text box, but it should display a digital panel on the tap. Is it possible?

+4
source share
2 answers

You can dynamically change the type of field. Sort of:

onFocus = "this.type = 'number'";

onBlur = "this.type = 'text'";
0
source

I would say stick with type = "text", and then do parseInt()a val input.

0
source

All Articles