ng2-validation
ng2-validation copied to clipboard
Phone Validation Does Not Work
The email validation works great on my screen. However, the phone validation always displays "error message" for these valid phone numbers: 1-555-111-3333, 555-111-3333, or 5551113333. Here is the code that I used:
Thank you in advance for your support.
Wen Hoang
in the latest version, 555-111-3333 and 5551113333 are correct. But the 1-555-111-3333 is not. You can see the regexp
/^(\(?[0-9]{3}\)?)((\s|\-){1})?[0-9]{3}((\s|\-){1})?[0-9]{4}$/
Phone validation is not working for me. If i use phone="US" on the input element, then validation will work only for numbers like 5551113333 but not 555-111-3333 or (555) 111-3333. Using phone="en-US" or [phone]="'en-US'" throws an error message saying "Unable to get property '9' of undefined or null reference" in the get_types function. I think that's within the LibPhoneNumber library. Just wondering if anyone else was seeing this.
@mikelt21 same for me: TypeError: Cannot read property '9' of undefined.
same for me: TypeError: Cannot read property '9' of undefined.
@mikelt21 you have a solution?
Having the same issue as @mikelt21
Getting this error after i upgraded to Angular 5 during phone validation.
ERROR TypeError: Cannot read property '9' of undefined at get_types (metadata.js:105) at Object.is_valid (validate.js:34) at Object.isValidNumber (index.es6.js:42)
Tried phone="US" but it doesn't work and breaks down. Unable to complete the forms with phone #.
Please Can anyone help?
Having the same issue with "zh-CN", and "'en-US" throws an error message saying "Unable to get property '9' of undefined or null reference"
when i use "US" the validation always fails with values like "1-555-111-3333", "555-111-3333", "5551113333" but when i use "IR" validation always succeeds no matter what is the input angular version : 7.2.0 ng2-validation: 4.2.0