Number validation

2 posts, 0 answers
  1. Stepochkin
    Stepochkin avatar
    2 posts
    Member since:
    Sep 2012

    Posted 20 May 2013 Link to this post

    After the last update kendo ui web (2013.1.514) i get the error for the decimal type value.
    Here are a few lines of code:

    <script src="<%= Url.Content("~/Scripts/kendo/2013.1.514/jquery.min.js") %>"></script>
        <script src="<%= Url.Content("~/Scripts/kendo/2013.1.514/kendo.all.min.js") %>"></script>
        <script src="<%= Url.Content("~/Scripts/kendo/2013.1.514/kendo.aspnetmvc.min.js") %>"></script>
        <script src="<%= Url.Content("~/Scripts/kendo/2013.1.514/cultures/") %>"></script>
        <script src="<%= Url.Content("~/Scripts/kendo.modernizr.custom.js") %>"></script>
        <script type="text/javascript">
            //set culture of the Kendo UI
    <a title="Сохранить (Ctrl + S)" class="k-button k-button-icontext" href="#" onclick="orderEditControlAction()" data-role="save"><span class="k-icon k-update"></span>Сохранить</a>
    <form id="formOrderEdit" method="post">
            <%:Html.HiddenFor(m => m.OrderId) %>
            <%:Html.LabelFor(m => m.Order_Weight) %>
             <%:Html.EditorFor(m => m.Order_Weight) %>
             <%:Html.ValidationMessageFor(m => m.Order_Weight) %>
    <script type="text/javascript">
        var validator = null;
        $(document).ready(function () {
            validator = $("#formOrderEdit").kendoValidator().data("kendoValidator");
        function orderEditControlAction() {
            if (validator.validate()) {
                    cache: false,
                    type: "POST",
                    url: "/Order/save",
                    data: $('#formOrderEdit').serialize(),
                    success: function (response, textStatus, jqXHR) {
                    error: function (data) {
                        alert("Ошибка при выполнении сохранения!");
            return false;
    public class OrderEditViewModel
            Guid OrderId { get; set; }
            [DisplayName("Кол-во изделий в тоннах")]
            decimal? Order_Weight { get; set; }
    Edit template
    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<decimal?>" %>
    <%: Html.Kendo().NumericTextBoxFor(m => m)
           .HtmlAttributes(new { style = "width:100%" })
    Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("ru-RU");
    Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("ru-RU");
    System.Web.Mvc.ModelBinders.Binders.Add(typeof(decimal?), new CultureAwareDecimalModelBinder());

    When i try to submit this form i get validation error
    Order_Weight is not valid.

    I also notated that is success in IE9 (in IE10, Opera e FF work fine).

  2. Georgi Krustev
    Georgi Krustev avatar
    3747 posts

    Posted 21 May 2013 Link to this post

    Hello Stepochkin,

    There is a known issue regarding NumericTextBox and culture different than en-US. The problem is addressed in the last internal build (2013.1.517). Please give it a try and let me know how it goes.

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