
im using asp.net code and javascript
theres an error telling me that 'Onkeypress' is not a valid attribute of element 'TextBox
because i need a textbox that you can only type numeric only numbers only...
what is wrong to my code?
pls give me the correct one.
jscript
<script language=javascript>
function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
</script>
HTML
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1"Onkeypress= "return isNumberKey(event)" runat="server" BorderStyle="Solid" Style="z-index: 100;
left: 184px; position: absolute; top: 99px"></asp:TextBox>
This post has been edited by PsychoCoder: 1 May, 2008 - 04:45 AM