function isNumber(evt, element) {
var charCode = (evt.which) ? evt.which : event.keyCode
if (
(charCode != 45 || $(element).val().indexOf('-') != -1) && // “-” CHECK MINUS, AND ONLY ONE.
(charCode != 46 || $(element).val().indexOf('.') != -1) && // “.” CHECK DOT, AND ONLY ONE.
(charCode < 48 || charCode > 57))
return false;
return true;
}
$('input[id$=txefetAmount],input[id$=txtsdfAmount],input[id$=txtsdAmount]').keypress(function (event) {
return isNumber(event, this)
});
var charCode = (evt.which) ? evt.which : event.keyCode
if (
(charCode != 45 || $(element).val().indexOf('-') != -1) && // “-” CHECK MINUS, AND ONLY ONE.
(charCode != 46 || $(element).val().indexOf('.') != -1) && // “.” CHECK DOT, AND ONLY ONE.
(charCode < 48 || charCode > 57))
return false;
return true;
}
$('input[id$=txefetAmount],input[id$=txtsdfAmount],input[id$=txtsdAmount]').keypress(function (event) {
return isNumber(event, this)
});
No comments:
Post a Comment