Search code examples
javascriptjqueryhtmlautonumeric.js

How to get empty field with autonumeric.js


I want to be able when I am focused on the field, and I have minimum an maximum limits (1-31), I want to be able to delete all the numbers, but it wont me let it to do that. If I enter 17, I can delete 7 and thats it. I want to be able to delete both digits and to re-enter some others. Currently my setup of autonomueric is:

Version: 1.9.45

    $("#field").autoNumeric({
        vMin: '1',
        vMax: '31',
        aPad: false,
        aSep: ''
    });

Solution

  • You can use following code

     $(".testInput").autoNumeric('init', {
               vMax: '31',
               vMin: '-1',
           aPad: false,
            aSep: ''
            });