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

Wrong value in NumericTextBox in Chrome

2 Answers 203 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
khandokar
Top achievements
Rank 1
khandokar asked on 02 Feb 2018, 07:27 AM

 

Hi there

da-DK is my culture name and I set the globalization correctly.I have a problem with NumericTextBox. My database field value is 4587.25.It is rendering expected in Firefox (4.587,25) and IE, but making a problem in Chrome (empty numeric textbox), I saw a warning in Chrome console.

The specified value "4587,25" is not a valid number.The value must match to the following regular expression:-?(\d+|\d+\.\d+|\.\d+)([eE][-+]?\d+)?

How can I fix this chrome behavior? I built a small a project and added some code to generate the problem. Index.cshtml contains a extension method BeginForm2(), inside this method I wrote my code.Download

Thanks

Sabbir

2 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 06 Feb 2018, 02:02 PM
Hello Sabbir,

The warning that you saw is fired by Chrome when displaying numbers formatted with anything else than en-US formatting in an <input type="number" /> element. This is one of the reasons why the type of the rendered input was changed to "text" in the 2015.3.1111 version.

I see that your project uses an older UI for ASP.NET MVC version, so I assume this is the reason why the input is incorrectly validated by Chrome when using a different culture.

The possible solutions would be to upgrade to version 2015.3.1111 (or newer) or use a client-side Kendo UI NumericTextBox, where you can declare the input type yourself.

Regards,
Tsvetina
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
khandokar
Top achievements
Rank 1
answered on 07 Feb 2018, 09:55 AM

Thanks Tsvetina

 i will do as your suggestion and let you know here

 

 sabbir

Tags
NumericTextBox
Asked by
khandokar
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
khandokar
Top achievements
Rank 1
Share this question
or