Link to home
Start Free TrialLog in
Avatar of Moti Mashiah
Moti MashiahFlag for Canada

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

 $("#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;
                }
            });

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Moti Mashiah
Moti Mashiah
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial