http://demos.telerik.com/aspnet-mvc/razor/NumericTextBox
but keep getting a "sorry there's a problem with our server".]
I've run into this problem too. How come I can enter, say, ".34" (no quotes, of course) into the first control (#NumericTextBox) on this page:
http://demos.telerik.com/aspnet-mvc/razor/NumericTextBox
but it doesn't allow the initial "." on my own page?
Is there a new version of the control being used on the demo page?
Thanks!
4 Answers, 1 is accepted
This is not a known issue. Check this screen cast, which I have made while testing on our online demos.
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
@(Html.Telerik().NumericTextBoxFor(model => model.VentingVacuum).Spinners(false))I can enter "0" into the rendered control and the Telerik control reformats it as "0.00" and accepts the field. I can enter "0.2" which is reformatted to "0.22" and is accepted. If I clear out the field then try to type a "." nothing is echoed; I must type "0." in order for the "." to be accepted. In other words, I must enter "0.2" and cannot enter ".2".
Here is the rendered HTML:
<div class="t-widget t-numerictextbox" id="VentingVacuum"><input class="t-input" data-val="true" data-val-number="The field Venting Vacuum must be a number." data-val-range="The field Venting Vacuum must be between 0 and 30." data-val-range-max="30" data-val-range-min="0" data-val-required="The Venting Vacuum field is required." id="VentingVacuum-input" name="VentingVacuum" value="0" /></div>and the validation JavaScript:
jQuery('#VentingVacuum').tTextBox({val:0, step:1, minValue:0, maxValue:30, digits:2, groupSize:3, negative:1, text:'Enter value', type:'numeric', inputAttributes:{}});Any ideas?
I am not sure where could be the issue. Probably there is different regional settings or the keyboard layout is not standard. I will need to replicate the issue locally in order to help you further.
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
public const int MIN_VALUE = 1;
public const int MAX_VALUE = 10;
[Display(Name="Field Name Here")]
[Range(MIN_VALUE, MAX_VALUE)]
public virtual double? Value { get; set; }The const's should be double not int!
While this was a coding bug perhaps the control could be taught to check the type of the Range values and upcast to double (in this case)? Or maybe issue a warning or error? Just a thought.