///////////////////////////////////////IntegerValidation ///////////////////////////////////////////////////////
$("#txtRequestedDays").keyup(function (e) {
if (/\D/g.test(this.value)) {
// Filter non-digits from input value.
this.value = this.value.replace(/\D/g, '');
}
});
///////////////////////////////////////Decimal Validation ///////////////////////////////////////////////////////
$("#txtRequestedDays").keyup(function () {
if (this.value != this.value.replace(/[^0-9\.]/g, '')) {
this.value = this.value.replace(/[^0-9\.]/g, '');
}
});
Thanks
ReplyDeleteyou welcome
Deletenah flickerring aka user shows the char then disappear!
ReplyDeleteuse something like :
$("#oCAUSE_goal, #oCAUSE_goalnow").keypress(function(e) {
if (!(e.keyCode >= 48 && e.keyCode <= 57))
e.preventDefault();
});
for integer input
Thanks for this post.
ReplyDeletenice post,here is also a way to findjquery numeric validation
ReplyDeleteThanks
ReplyDelete