Hi Friends, in this post I would like to explain Java Script function for entering only Integers values in Textbox.
JavaScript Function:
<script type="text/javascript" language="javascript">
function isNumberKey()
{
if(!(((event.keyCode>=48&&event.keyCode<=57) || (event.keyCode>=96&&event.keyCode<=105))||(event.keyCode==8) || (event.keyCode==9) || (event.keyCode==37) || (event.keyCode==39) || (event.keyCode==46) || (event.keyCode==190)))
event.returnValue=false;
}
script>
Calling the above function from Textbox control:
<asp:TextBox ID="txtNumericValue" runat="server" Width="120px" onkeydown="isNumberKey();">asp:TextBox>
So that we can enter only Integer Values in the TextBox.
Thank You…
good one.
hello site nice post
its really very use full for me... i m also getting nice code form
codeprojectdownload.com
it may be usefull for visitor