Return to Snippet

Revision: 67593
at October 9, 2014 20:28 by sebabarre


Initial Code
$("#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); 
				} 
			});

Initial URL

                                

Initial Description
N'autorise que les chiffres (avec , ou . ou négatifs) dans un input

Initial Title
Only Numbers In An Input

Initial Tags
form, javascript, html, jquery

Initial Language
jQuery