Restrict user from entering unlimited number of decimals

2 posts, 0 answers
  1. Rick Nguyen
    Rick Nguyen avatar
    21 posts
    Member since:
    May 2006

    Posted 17 Jul 2014 Link to this post

    In the example below, how can I restrict a user from entering more than 5 decimals in the textbox? 


    @(Html.Kendo().NumericTextBox<decimal>()
     .Name("maxVarianceAmount")
     .HtmlAttributes(new { style = "width:75px" })
     .Format("c5")
     .Min(0)
     .Value(@ViewBag.MatchProcessor.VarianceAmount)
     .Decimals(5)
     .Spinners(false)
     ) 
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 18 Jul 2014 Link to this post

    Hello Rick,

    Kendo UI NumericTextBox is designed to restrict user input based on min/max value, but it does not do that for the decimal digits. Widget has a decimals option, which specifies the precision of the number. If this does not help you, then you will need to manually restrict user input using a custom JavaScript implementation, which falls out of the scope of the entitled technical support.

    Regards,
    Georgi Krustev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top