Cannot set negative value in NumericTextBox

2 posts, 0 answers
  1. DJo
    DJo avatar
    23 posts
    Member since:
    Nov 2012

    Posted 05 Jun 2013 Link to this post

    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?
  2. DJo
    DJo avatar
    23 posts
    Member since:
    Nov 2012

    Posted 06 Jun 2013 Link to this post

    Solved:

    I had min="0" on the HTML input. D'oh!
  3. Kendo UI is VS 2017 Ready
Back to Top