Wednesday, December 24, 2008

TextBox with numeric input only : textbox, only, numeric, input

function ISonlynumber(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
<asp:TextBox ID="txtmobileNO" Runat="server" Width="150" MaxLength="64" onkeypress="javascript:return ISonlynumber(event);"></asp:TextBox>
Share:

0 Comments:

Post a Comment