NumericTextBox with ASP MVC Wrapper and Microsoft Edge

2 posts, 1 answers
  1. Netapsys
    Netapsys avatar
    1 posts
    Member since:
    May 2014

    Posted 12 Oct 2015 Link to this post

    I'm using KendoUI with Microsoft Edge and I have some problems with ASP MVC Wrapper and NumericTextBox when I use French culture :
    My server culture is set to "fr-FR", so all Html.TextBoxFor and Html.Kendo().CurrencyTextBox() render numeric values with "," instead of "."

    <input type="number" value="42,02" id="test" name="test" />

    Original razor code :

    With Chrome, IE11, Firefox => Display = 42,02
    With Microsoft Edge => Display nothing : Input is Blank

  2. Answer
    Georgi Krustev
    Georgi Krustev avatar
    3747 posts

    Posted 14 Oct 2015 Link to this post

    Hello Netapsys,

    The described behavior is a known issue related to MS Edge. The MVC wrapper for NumericTextBox renders an input element with type="number", which is done for graceful degradation purposes. This, however, does not work in Edge, because it ignores any value that is not valid "en-US" number.

    If you do not want to upgrade, then you can just render the input element type="text". Thus the browser will not ignore the value and the widget will be able to work as expected:
    @Html.Kendo().CurrencyTextBox().Name("test").HtmlAttributes(new { type = "text" }).Value((decimal?)42.02d)

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top