Can't reset value of NumericTextBox

5 posts, 0 answers
  1. Bryan
    Bryan avatar
    1 posts
    Member since:
    Jul 2012

    Posted 31 Jul 2012 Link to this post

    I can set the value to a specific amount like this:
    But if I try this after setting the value as above, the value does not change.
    I have also tried the following with nothing being able to clear out the previously set value.

    Is there any way to clear out the value once it's been set?
  2. John DeVight
    John DeVight avatar
    209 posts
    Member since:
    Jan 2010

    Posted 09 Aug 2012 Link to this post

    Hi Bryan,

    There are several things that need to happen to clear the value.  If I have a NumericTextBox defined as follows:

    var _numeric = $("#numeric").kendoNumericTextBox({
        min: 0,
        max: 100
    I could clear it with the following lines of code:
    _numeric._old = _numeric._value;
    _numeric._value = null;

    Another possibility is if you want to use this for any of your NumericTextBox controls, you could extend the NumericTextBox.  This would be done after the reference to the kendo javascript library, but before any NumericTextBox's are created.  Here would be the code:

    $.extend(window.kendo.ui.NumericTextBox.fn, {
        clear: function() {
            this._old = this._value;
            this._value = null;

    Then, to clear a NumericTextBox, you could call the clear function like this:


    Attached is an example of this.


    John DeVight
  3. Jack
    Jack avatar
    4 posts
    Member since:
    Feb 2015

    Posted 11 Jan 2016 Link to this post

    Thank you Mr. DeVight.  You helped me out a lot.  Works great.
  4. Allan
    Allan avatar
    12 posts
    Member since:
    Oct 2012

    Posted 03 Oct 2017 Link to this post

    Whilst this does indeed clear the textual value, the tooltip remains when you hover over the "cleared" input field.  Is there a way to also clear that, or better yet, Telerik, what is correct way to reset the numeric textbox back to empty?
  5. Tsvetina
    Tsvetina avatar
    2481 posts

    Posted 06 Oct 2017 Link to this post

    Hello Allan,

    You can set the NumericTextBox value to null to clear the textbox and tooltip:
    var numeric = $("#currency").data("kendoNumericTextBox");


    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top