Avatar of Whing Dela Cruz
Whing Dela Cruz
Flag 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


Avatar of undefined
Last Comment
Whing Dela Cruz

8/22/2022 - Mon