Yes this code is working for me this is a javascript code only ..
Check the below complete code which I have written
<head>
<title>Untitled Page</title>
<script type="text/javascript">
function NumberOnly() {
var AsciiValue = event.keyCode
if ((AsciiValue >= 48 && AsciiValue <= 57) || (AsciiValue == 8 || AsciiValue == 127))
event.returnValue = true;
else
event.returnValue = false;
}
</script>
</head>
<body>
Text Box 1
<input type="text" id="txt1" onkeypress="return NumberOnly()"/>
</body>
</html>
Thanks & Rgards,
Dhiren Kumar Kaunar
Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator