// HTML
<asp:TextBox ID="TextBox1" runat="server"
onkeypress="return
isNumber(this, event);">
// JS
<script type="text/javascript">
function Is_Double_Exits(obj, event) {
debugger;
var charCode = (event.which) ? event.which : event.keyCode;
if (charCode == 46) { // keycode of decimal
if (obj.value.indexOf('.') === -1) {
return true;
}
else {
return false;
}
}
else {
if (charCode > 31 && (charCode < 48 ||
charCode > 57)) {
return false;
}
else {
return true;
}
}
return true;
}
</script>
No comments:
Post a Comment