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

Restrict user from entering unlimited number of decimals

1 Answer 307 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Rick Nguyen
Top achievements
Rank 1
Rick Nguyen asked on 17 Jul 2014, 05:54 PM
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)
 ) 

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 18 Jul 2014, 08:30 AM
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.

 
Tags
NumericTextBox
Asked by
Rick Nguyen
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or