ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: stevejacobsen on February 06, 2017, 04:48:49 am

Title: Problem with Phone validation
Post by: stevejacobsen on February 06, 2017, 04:48:49 am
I'm trying to validate a phone number but it keeps giving me a validation error. I tested the regex on regex101.com.

Quote
        {title: "Cell", width: 150, dataIndx: "cell", align: "center", dataType: "string",
            validations: [
                {type: 'regexp', value: "\([0-9]{3}\) [0-9]{3}-[0-9]{4}$", msg: "That does not appear to be a valid US phone number in the format (712) 555-1212!"},
            ]
        },
Title: Re: Problem with Phone validation
Post by: paramvir on February 06, 2017, 11:13:56 pm
Please assign a regular expression object to value as below:

Code: [Select]
  value: /^\([0-9]{3}\)\s[0-9]{3}-[0-9]{4}$/