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

[Solved] Increment step validation when value keyboard typed?

1 Answer 20 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.
Shawn Cassedy
Top achievements
Rank 1
Shawn Cassedy asked on 23 Jun 2011, 06:44 PM
Am I missing this feature? Do you have an example of how to accomplish this? Example:

 @(Html.Telerik().NumericTextBox()
.Name("Value")
.Spinners(true)
.Enable(true)
.MinValue(28)
.MaxValue(46)
.IncrementStep(1)
.EmptyMessage("")
.InputHtmlAttributes(new { style = "width: 58px;", tabindex = "2" })
)

Min / Max validate and stepping 1 by using the spinners works fine. However, you can type any value in the range, including decimals. So, 28.5 is allowed even though the step is 1. I might also have ranges that are in .5 or .25 but typed values of .12 or .35 would be allowed.

Certainly we could validate these ourselves, i just wanted to make sure before we go down that path.

Thanks for your efforts! These are great open source tools.

1 Answer, 1 is accepted

Sort by
0
Shawn Cassedy
Top achievements
Rank 1
answered on 23 Jun 2011, 09:21 PM
I'll update my own question to say, Yes, I missed the fact that I should have been using IntegerTextBox for an increment step of 1. However, the question still remains for an increment of .25.
Tags
NumericTextBox
Asked by
Shawn Cassedy
Top achievements
Rank 1
Answers by
Shawn Cassedy
Top achievements
Rank 1
Share this question
or