• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

validate phone

Explorer ,
Sep 20, 2011 Sep 20, 2011

Copy link to clipboard

Copied

Hi,

how can i valide the US and Internation Phone Number?

the phone field stored data like below

79587560052185

81-29-875-9853

49 2208 6004 232

713.445-7896,

(011) 32516988975,

7(459)_-542-6859

49-(0)8153-28-3219

i can tell it stored with all the diffrent format and don't know how to validate them.

thanks

TOPICS
Advanced techniques

Views

574

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 20, 2011 Sep 20, 2011

Copy link to clipboard

Copied

There's no point trying.  Even if you were only validating against a known pattern, that's still not to say the value is a valid phone number (which, at the end of the day, is what you want).

What precisely are you trying to gain by doing this validation (and don't say "making sure they're valid" ;-)?

--

Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 21, 2011 Sep 21, 2011

Copy link to clipboard

Copied

You could use the isValid function, with type telephone or regex.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 21, 2011 Sep 21, 2011

Copy link to clipboard

Copied

You could use the isValid function, with type telephone or regex.

The isValid() phone option only supports - somewhat jingoistically, IMO - US formats.  Not much chop for most people out there, unfortunately.

--

Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 21, 2011 Sep 21, 2011

Copy link to clipboard

Copied

LATEST

Everything I thought has already been said, I just felt the need to show my appreciation for some excellent use of the word "jingoistically" there.

Incidentally, isValid("email") also sticks to no standards whatsoever.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation