Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to validate a german telephone number using javascript?

In an application i need to validate a form field for german telephone numbers,tried some but doesnt works exactly, any help will be appreciated..

like image 311
Shanib Avatar asked Jan 10 '13 09:01

Shanib


1 Answers

The answers to this question should solve this for you: Validate phone number with JavaScript

You just need to adjust the regex to suit the German format

The regex from https://github.com/posabsolute/jQuery-Validation-Engine/issues/265 might do the job: /^([+][0-9]{1,3}[ .-])?([(]{1}[0-9]{1,6}[)])?([0-9 .-/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/

like image 104
Edd Avatar answered Sep 20 '22 10:09

Edd