/ Published in: jQuery
                    
                                        
Méthode n'autorisant que les nombres (positifs/négatifs/décimaux avec virgules ou points) dans un champ
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
$("#inputTarif").keypress(function(event){
var charCode = (event.which) ? event.which : window.event.keyCode;
if (charCode <= 13) { return true;}
else {
var keyChar = String.fromCharCode(charCode);
var Exp = new RegExp("[0-9,.-]");
return Exp.test(keyChar);
}
});
Comments
 Subscribe to comments
                    Subscribe to comments
                
                