Design:
<asp:Content ID="Content1" ContentPlaceHolderID="contentPlaceHolder" Runat="Server"><script type="text/javascript">
//Numbers and dots
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode != 46 && (charCode < 48 || charCode > 57)) {
return false;
}
else {
return true;
}
}
//Number and spaces
function isNumberKey1(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode != 32 && (charCode < 48 || charCode > 57)) {
return false;
}
else {
return true;
}
}
</script>
<asp:TextBox ID="txtMFGQty" runat="server" Height="22px" Width="224px" onkeypress= "return isNumberKey(event)"
MaxLength="12"></asp:TextBox>
<asp:TextBox ID="txtPhoneNo" onkeypress= "return isNumberKey1(event)" runat="server" Width="200px" MaxLength="12"></asp:TextBox>
No comments:
Post a Comment