TheBoubou
TheBoubou

Reputation: 19933

Phone number formatting validation

How would I validate with Javascript/jQuery that a phone number matches the format of +322123456?

  1. The +32 is mandatory, and the phone number begins with it.
  2. After the +32, 8 or 9 numbers

Upvotes: 0

Views: 238

Answers (3)

ShankarSangoli
ShankarSangoli

Reputation: 69915

Use regex to do that.

/\+32\d{8,9}/

Upvotes: 5

xkeshav
xkeshav

Reputation: 54050

try

\+32\d{8,9}

DEMO

Upvotes: 4

Navneeth G
Navneeth G

Reputation: 7305

You use this regex : \+32[0-9]{8}[0-9]+ to check that.

Upvotes: 0

Related Questions