<script type="text/javascript">
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode;
if (charCode >= 48 && charCode <= 57) {
return true;
}
else {
alert('number only');
return false;
}
}
</script>
<asp:TextBox ID="TextBox2" runat="server"
onkeypress="return isNumberKey(event)" ></asp:TextBox>
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode;
if (charCode >= 48 && charCode <= 57) {
return true;
}
else {
alert('number only');
return false;
}
}
</script>
<asp:TextBox ID="TextBox2" runat="server"
onkeypress="return isNumberKey(event)" ></asp:TextBox>
No comments:
Post a Comment