How to only accept positive integer in Jquery spinner?

seb68 picture seb68 · May 24, 2013 · Viewed 7k times · Source
'<label id="quantite" for="quantite">Quantite : </label><input id="QteSpinner" value="1"></br>'

[...]

var newSpinner = $( "#QteSpinner" ).spinner({
            min: 1
        }); 

How could I restrict the user to only type numbers in a JQuery spinner like this one?

Thanks

Answer

itsazzad picture itsazzad · May 5, 2014

Use

{decimals:0}

or

{min:0}

or both together in the options