<head runat="server">
<script type="text/javascript">
function FilterInput (event) {
var keyCode = ('which' in event) ? event.which : event.keyCode;
isNumeric = (keyCode >= 48 && keyCode <= 57) ||
(keyCode >= 96 && keyCode <= 105 );
modifiers = (event.altKey || event.ctrlKey || event.shiftKey);
return !isNumeric || modifiers;
}
<script type="text/javascript">
function FilterInput (event) {
var keyCode = ('which' in event) ? event.which : event.keyCode;
isNumeric = (keyCode >= 48 && keyCode <= 57) ||
(keyCode >= 96 && keyCode <= 105 );
modifiers = (event.altKey || event.ctrlKey || event.shiftKey);
return !isNumeric || modifiers;
}
</script>
<script type="text/javascript">
function isNumeric(keyCode)
{
// return ((keyCode >= 48 && keyCode <= 57) || keyCode == 8)
return (((keyCode >= 48 && keyCode <= 57)||(keyCode >= 96
&& keyCode <= 105) ) || keyCode == 8)
}
</script>
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2>In Text Only Numeric Value is inter</h2>
<asp:TextBox ID="TextBox1" onkeydown = "return
isNumeric(event.keyCode);" autocomplete="off" runat="server"
MaxLength="3"></asp:TextBox>
<h2>In Text Only Char Are inter Value </h2>
<asp:TextBox ID="TextBox2" onkeydown="return FilterInput
(event)" runat="server"></asp:TextBox>
</div>
</form>
</body>
function isNumeric(keyCode)
{
// return ((keyCode >= 48 && keyCode <= 57) || keyCode == 8)
return (((keyCode >= 48 && keyCode <= 57)||(keyCode >= 96
&& keyCode <= 105) ) || keyCode == 8)
}
</script>
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2>In Text Only Numeric Value is inter</h2>
<asp:TextBox ID="TextBox1" onkeydown = "return
isNumeric(event.keyCode);" autocomplete="off" runat="server"
MaxLength="3"></asp:TextBox>
<h2>In Text Only Char Are inter Value </h2>
<asp:TextBox ID="TextBox2" onkeydown="return FilterInput
(event)" runat="server"></asp:TextBox>
</div>
</form>
</body>
No comments:
Post a Comment