<script src="jquery-1.6.4.js" type="text/javascript"></script>
<script type="text/javascript"> function maskInput() { var key_code = window.event.keyCode; var oElement = window.event.srcElement; if (!window.event.shiftKey && !window.event.ctrlKey && !window.event.altKey) { if ((key_code > 47 && key_code < 58) || (key_code > 95 && key_code < 106)) {
if (key_code > 95) key_code -= (95-47); oElement.value = oElement.value; } else if(key_code == 8) { oElement.value = oElement.value; } else if(key_code != 9) { event.returnValue = false; } } } (document).ready(function() { $('#myTextbox').keydown(maskInput); }); </script>
|