Moti Mashiah
asked on
query calc
Hi guys,
I'm trying to find a way how to prevent users from insert string to price textbox so I found something like this:
Actually it works fine, the only issue is users can't insert dot as well just numbers
I'm trying to find a way how to prevent users from insert string to price textbox so I found something like this:
Actually it works fine, the only issue is users can't insert dot as well just numbers
$("#Price").keypress(function (e) {
//if the letter is not digit then display error and don't type anything
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
//display error message
//$("#error").html("Number Only").show().fadeOut("slow");
return false;
}
});
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.