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

Cannot set negative value in NumericTextBox

1 Answer 1151 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
DJo
Top achievements
Rank 1
DJo asked on 05 Jun 2013, 09:45 PM
I have a trivial NumericTextBox in my application:
$("#number").kendoNumericTextBox({
    format: "c0",
    decimals: 2,
    spinners: false
});
I have an event handler elsewhere that tries this:
function updateNumber() {
    var numberBox = $("#number").data("kendoNumericTextBox");
    var anothernumberBox = $("#anotherNumber").data("kendoNumericTextBox");
    var yetanothernumberBox = $("#yetanotherNumber").data("kendoNumericTextBox");
    try {
        numberBox.value(anothernumberBox.value() - yetanothernumberBox.value());
    }
    catch (err) {
        //
    }
};
This works great as long as the number that numberBox.value() is set to is positive.
If the number is negative it fails.

I've tried messing with the min on the numberBox with no improvement.

How can I set the value() property on a NumericTextBox to a negative value?

1 Answer, 1 is accepted

Sort by
0
DJo
Top achievements
Rank 1
answered on 06 Jun 2013, 04:07 PM
Solved:

I had min="0" on the HTML input. D'oh!
Tags
NumericTextBox
Asked by
DJo
Top achievements
Rank 1
Answers by
DJo
Top achievements
Rank 1
Share this question
or