INPUT BOX:
<input type="text" id='number' name="mobile"/>
CODE:
<script> $("#number").keydown(function(event) { if ( $.inArray(event.keyCode,[46,8]) !== -1 || (event.keyCode == 65 && event.ctrlKey === true) || (event.keyCode >= 35 && event.keyCode <= 39)) { return; } else { if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105 )) { event.preventDefault(); } } }); </script>
Live Example Jsfiddle: https://jsfiddle.net/akhilreddyyalla/o2gxgz9r/46109/
Comments
Post a Comment