Monday, September 17, 2007

Restrict Numberic Input In TextBox

<script language="javascript">
function blockNum(e)
var keyVal =(window.event) ? event.keyCode : e.keyCode;
if (window.event) keyVal = window.event.keyCode;
if((keyVal > 47 && keyVal < 58) || (keyVal > 95 && keyVal < 107))
return false;
<body onload="javascript:document.getElementById('txt').focus();">
<input type="text" id='txt' onkeydown="return blockNum(this);" />

Program Demo

No comments:

Creative Commons License
Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.