Allow Only Numbers in a Textbox

It can be possible using .net and javascript

.Net :
        You have asp control to validate you web part.

JavaScript :
           In this , you need to write code in <Script> Tag like


<script language="JavaScript">
function onlyNumbers(evt)
{
var e = event || evt;  var charCode = e.which || e.keyCode;

 if (charCode > 31 && (charCode < 48 || charCode > 57))
  return false;

 return true;

} </script>

Comments

Popular posts from this blog

Add Serial no in crystal report without coding

Working with Oracle's BLOB and Microsoft's C#

File operations in C# (.net)