Number inputs for integers

0
Hi all, I noticed integers utilize input fields of the type text and not number, what would be the best way to achieve this (simply for an improved user-experience)? Thanks in advance!
asked
1 answers
4

Hi Anees,

I had similar kind of requirement where I had to display num keypad on mobile for integer input field of text type.

I used UX manipulator widget to acheive this. This widget will allow you to manipulate the html dom attributes, please see the screenshot below for example.

Add a class on input field and in the widget use that .class input (this will search for the input of that class) , then define the value you want to update with and then the html dom attribute that you want to manipulate. For more detals see widget documentation.

 

 

Note: I used tel instead of num because I have another manipulation to set the maxlength of input to 6 (see screenshot below) and if I use tel then maxlength value was not used or was not valid and users were allowed to enter unlimited digits.

 

 

Hope this helps!

answered