This is a migrated thread and some comments may be shown as answers.

Numeric Text Box on Mobile

2 Answers 57 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 13 Jan 2014, 05:58 AM
Hi,
I am trying to get the numeric text box to be of type 'number' so that it displays the numeric keypad on mobile, but uses the arrows on desktop.
But from looking at the code, it appears that the input type should be 'number', so I am confused.
I am probably missing something as I am relativley new to kendo.


Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 13 Jan 2014, 09:04 AM
Hello Ryan,

The NumericTextBox widget is designed to change the type of the input element to text. This is required, because the widget supports internationalized standard and custom numeric formats, which are not allowed in type="number" element. One possible solution is to use a pattern attribute, which will tell the iOS to open keyboard in numeric mode. Please note that this approach does not work in Android devices.

Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ryan
Top achievements
Rank 1
answered on 24 Jan 2014, 12:32 AM
Hi Georgi,
Thanks for the reply. This is a bit of an issue for us and have a solution by changing the type the type back on page load.
For integers this seems to work well, which is all we need it for.

document.getElementById('WidthInput').setAttribute('type', 'number');

This cant be done through jQuery as it ignores setting the type as it does not work in IE, but that is not an issue for us.
Tags
NumericTextBox
Asked by
Ryan
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or