Allow Numeric only in a textbox using javascript:
<script language="javascript" type="text/javascript">
function allowNumericOnly(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode;
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
</script>
<asp:TextBox ID="txtSalary" runat="server" onkeypress="return allowNumericOnly(event)"></asp:TextBox>
0 comments:
Post a Comment