Textfield only accept numeric values jQuery


Source Code:

<script>
$(document).ready(function() {
	$("input").keydown(function(event) {
		if ( event.keyCode != 46 && event.keyCode != 8 && (event.keyCode < 48 && event.keyCode > 57 ) ) {
			event.preventDefault();
		}
	});
});
</script>

Reviews and Comments