Link to home
Start Free TrialLog in
Avatar of Whing Dela Cruz
Whing Dela CruzFlag for Anguilla

asked on

Validating number not work with decimal

Hi experts, I'm using code in a purpose of validating number, but I've found out that when I use decimal the code will no longer identify as number. I wish to include here decimals and recognize as number. any help pls!

    var regex=/^[0-9]+$/;
    if (!uc.match(regex) || !sp.match(regex) || !qty.match(regex) || !reOr.match(regex))
    {
        alert("Input must be numbers");
        return false;
    }

Open in new window

SOLUTION
Avatar of zephyr_hex (Megan)
zephyr_hex (Megan)
Flag of United States of America 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
ASKER CERTIFIED SOLUTION
Avatar of Big Monty
Big Monty
Flag of United States of America 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
SOLUTION
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
Avatar of Whing Dela Cruz

ASKER

Thank you all of you guys, its all useful to me. More power to  you all!