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

[Solved] limit number of characters entered

2 Answers 130 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
aa1237
Top achievements
Rank 1
aa1237 asked on 22 Mar 2010, 10:18 PM
Is there a way to limit the number of characters entered?   I need to only allow the user to enter 5 digits.

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 23 Mar 2010, 09:35 AM
Hello aa1237,

I suppose that you are talking for NumericTextBox component. You can achieve your goal  as you set the MaxValue and MinValue. Thus the component will validate the input and will put t-state-error CSS class, but will not stop the the user to enter more digits.

If you need to stop user to enters more than five digits, you can wire the OnChange event and perform the required actions.

All the best,
Georgi Krustev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Accepted
Greg Hendee
Top achievements
Rank 1
answered on 14 May 2010, 09:45 AM
If you hadn't found this, this property will also work:

.InputHtmlAttributes(

 

new { maxlength = "5" })

 

Tags
NumericTextBox
Asked by
aa1237
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Greg Hendee
Top achievements
Rank 1
Share this question
or