jcadima
6/21/2017 - 7:19 PM

Numbers and decimals only field

Numbers and decimals only field

http://jsfiddle.net/ecDmn/1/


// apply this to all inputs with a class name of num
jQuery(".num").keyup(function() {
    var $this = jQuery(this);
    $this.val($this.val().replace(/[^\d.]/g, ''));        
});
    
// valid input:  9 ,  9.0