Is Valid Number
This is a quick JavaScript function using regular expressions to make sure a string is a number. It checks to see if a plus or minus sign (optional) is at the start of the string, then one or more digits, then an optional grouping of a decimal followed by one or more digits at the end of the string. function isValidNumber(inpString) {
return /^[-+]?\d+(\.\d+)?$/.test(inpString);
}