var numericBox = $("#numeric_" + attrObj.AttributeId).data("kendoNumericTextBox");
numericBox.validationMessage = "Please enter value 5 and above";
So when I enter 3 for example in the above numberBox, it is supposed to give an error saying "Please enter value 5 and above". Instead the value of the box changes to 5 and no error is shown. This behavior is not acceptable. Is there anyway I can change this?
7 Answers, 1 is accepted
I attempted to hook into the change event, but the _old and _new properties match every time, and it would have been doable if those values showed the _old as [some giant number] and _new as [the max that we defaulted to]. Then I could show an error.
Please, any assistance would be appreciated.
I am afraid that the described behavior is currently not supported out of the box, however similar behavior could be achieved using a Kendo UI Validator with custom rule. For example:
It is possible to replace the min and max options with data attributes, thus preventing the widget from changing the value if it is out of range. Then in the custom rule you could get the min and max values through the attributes and proceed with the validation. For example:
I received similar project requirements and solved it by simple hacking. What I did is to replace the _adjust function to my version to add "outOfRange" event triggers when value is not between max and min. Here is the demo.
Notice: this hacking may be broken after Kendo UI upgrade.
We use Angular validation and would like an error message as well. Is it still not supported to raise a validation error without changing the value?
I cant see how it is ever acceptable to just change the users input. Telerik should really reconsider this functionality.