Skip to main content
Inspiring
September 20, 2011
Question

validate phone

  • September 20, 2011
  • 2 replies
  • 721 views

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

This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
September 21, 2011

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

Inspiring
September 21, 2011

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

Owainnorth
Inspiring
September 21, 2011

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.

Inspiring
September 20, 2011

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