SimplyZ February 2016

How to display blank kendo numeric text box on page load and still allow a min value

I have a kendo numeric text-box with a min value set to zero. I don't want the ability to input negative numbers. The problem is that the initial value gets also set to zero which messes up some validation. Is there a way to have the min be zero and still allow the box to be blank on load? I've tried adding

 value: " "

to noNegativeNumericConfig, but that doesn't seem to work.

html:

 <input class="numeric-entry" kendo-numeric-text-box k-options="noNegativeNumericConfig"

.js file:

  $scope.noNegativeNumericConfig =
     {
         spinners: false,
         decimals: 0,
         format: "#:n0",
         min: 0
     };

Answers


Marco Palma February 2016

Probably you will need to do on the widget initialization, like:

$scope.noNegativeNumericConfig =
     {
         spinners: false,
         decimals: 0,
         format: "#:n0",
         min: 0,
         value:" "
     };

Hope this help

Post Status

Asked in February 2016
Viewed 1,700 times
Voted 6
Answered 1 times

Search




Leave an answer